Enable prefix based routing (#2047)
* Enable prefix based routing Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com> * Optimize checking condition Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Disable few tests * disable router modification for now * run code generator * Collect fission dump in CI * Enable all tests back Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Remove unwanted code Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Add prefix support at more places and couple of todo's Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Few more changes Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Improve function trim support * Support for prefix based urls in fission function test Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * multi route for fission function test Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Improve validations in trigger creations * Adjust leading / in url from fission Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Change suburl to subpath for function test Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
co-authored by
Sanket Sudake
parent
f01de5c802
commit
aa45703a99
@@ -132,7 +132,11 @@ func (a *API) checkHTTPTriggerDuplicates(t *fv1.HTTPTrigger) error {
|
||||
// Same resource. No need to check.
|
||||
continue
|
||||
}
|
||||
if ht.Spec.RelativeURL == t.Spec.RelativeURL && ht.Spec.Method == t.Spec.Method && ht.Spec.Host == t.Spec.Host {
|
||||
urlMatch := false
|
||||
if ht.Spec.RelativeURL == t.Spec.RelativeURL || (ht.Spec.Prefix != nil && t.Spec.Prefix != nil && *ht.Spec.Prefix != "" && *ht.Spec.Prefix == *t.Spec.Prefix) {
|
||||
urlMatch = true
|
||||
}
|
||||
if urlMatch && ht.Spec.Method == t.Spec.Method && ht.Spec.Host == t.Spec.Host {
|
||||
return ferror.MakeError(ferror.ErrorNameExists,
|
||||
fmt.Sprintf("HTTPTrigger with same Host, URL & method already exists (%v)",
|
||||
ht.ObjectMeta.Name))
|
||||
|
||||
Reference in New Issue
Block a user