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
@@ -276,7 +276,13 @@ func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryC
|
||||
|
||||
if triggerObj.Spec.FunctionReference.Type == fv1.FunctionReferenceTypeFunctionWeights &&
|
||||
triggerObj.Spec.FunctionReference.FunctionWeights[canaryConfig.Spec.NewFunction] != 0 {
|
||||
failurePercent, err := canaryCfgMgr.promClient.GetFunctionFailurePercentage(triggerObj.Spec.RelativeURL, triggerObj.Spec.Method,
|
||||
var urlPath string
|
||||
if triggerObj.Spec.Prefix != nil && *triggerObj.Spec.Prefix != "" {
|
||||
urlPath = *triggerObj.Spec.Prefix
|
||||
} else {
|
||||
urlPath = triggerObj.Spec.RelativeURL
|
||||
}
|
||||
failurePercent, err := canaryCfgMgr.promClient.GetFunctionFailurePercentage(urlPath, triggerObj.Spec.Method,
|
||||
canaryConfig.Spec.NewFunction, canaryConfig.ObjectMeta.Namespace, canaryConfig.Spec.WeightIncrementDuration)
|
||||
|
||||
if err != nil {
|
||||
@@ -298,7 +304,7 @@ func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryC
|
||||
if failurePercent == -1 {
|
||||
// this means there were no requests triggered to this url during this window. return here and check back
|
||||
// during next iteration
|
||||
canaryCfgMgr.logger.Info("total requests received for url is 0", zap.String("url", triggerObj.Spec.RelativeURL))
|
||||
canaryCfgMgr.logger.Info("total requests received for url is 0", zap.String("url", urlPath))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user