Support for multiple HTTP verbs in routes/HTTPTrigger (#2064)

* Support for multiple HTTP verbs in routes/HTTPTrigger

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* Update pkg/apis/core/v1/types.go

Co-authored-by: Harsh Thakur <harshthakur9030@gmail.com>

* Fix fallbackurl for ingress

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Co-authored-by: Harsh Thakur <harshthakur9030@gmail.com>
This commit is contained in:
Sanket Sudake
2021-06-14 14:48:27 +05:30
committed by GitHub
co-authored by Harsh Thakur
parent 4038f0384b
commit 673ca25cf2
18 changed files with 166 additions and 39 deletions
+14 -2
View File
@@ -282,9 +282,21 @@ func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryC
} else {
urlPath = triggerObj.Spec.RelativeURL
}
failurePercent, err := canaryCfgMgr.promClient.GetFunctionFailurePercentage(urlPath, triggerObj.Spec.Method,
methods := triggerObj.Spec.Methods
if len(triggerObj.Spec.Method) > 0 {
present := false
for _, m := range triggerObj.Spec.Methods {
if m == triggerObj.Spec.Method {
present = true
break
}
}
if !present {
methods = append(methods, triggerObj.Spec.Method)
}
}
failurePercent, err := canaryCfgMgr.promClient.GetFunctionFailurePercentage(urlPath, methods,
canaryConfig.Spec.NewFunction, canaryConfig.ObjectMeta.Namespace, canaryConfig.Spec.WeightIncrementDuration)
if err != nil {
// silently ignore. wait for next window to increment weight
canaryCfgMgr.logger.Error("error calculating failure percentage",