Add support for Host matching in HTTP triggers (#425)

Include Host in httptrigger output table and fix duplicate error detection to consider Host as well.
This commit is contained in:
Adam Bouhenguel
2017-12-11 01:22:05 -06:00
committed by Soam Vasani
parent dff34b08e9
commit be84a864fb
3 changed files with 11 additions and 6 deletions
+2 -2
View File
@@ -51,9 +51,9 @@ func (a *API) checkHTTPTriggerDuplicates(t *crd.HTTPTrigger) error {
return err
}
for _, ht := range triggers.Items {
if ht.Spec.RelativeURL == t.Spec.RelativeURL && ht.Spec.Method == t.Spec.Method {
if ht.Spec.RelativeURL == t.Spec.RelativeURL && ht.Spec.Method == t.Spec.Method && ht.Spec.Host == t.Spec.Host {
return fission.MakeError(fission.ErrorNameExists,
fmt.Sprintf("HTTPTrigger with same URL & method already exists (%v)",
fmt.Sprintf("HTTPTrigger with same Host, URL & method already exists (%v)",
ht.Metadata.Name))
}
}