-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: Admission Webhook blocks ScaledObject without metricType with fallback #6702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…llback Signed-off-by: rickbrouwer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
could you please also add an e2e test for this case so future KEDA releases are a bit safer? Don't feel pressured, if it's not in your capacity at the moment, I'm happy to approve this as is and add the e2e test coverage later this week.
/run-e2e fallback|scaling_modifiers |
Signed-off-by: Rick Brouwer <[email protected]>
I'll add a unit test first. That also does a good check. I saw that I will create a test case in the e2e of fallback later. |
Signed-off-by: rickbrouwer <[email protected]>
Also added an e2e test |
/run-e2e fallback|scaling_modifiers |
Signed-off-by: Rick Brouwer <[email protected]>
Added more unit tests for the remaining functions of scaledobject_types |
/run-e2e fallback|scaling_modifiers |
Signed-off-by: Rick Brouwer <[email protected]>
Signed-off-by: Rick Brouwer <[email protected]>
/run-e2e fallback|scaling_modifiers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
In scaler.go there is a function GetMetricTargetType which helps get the metric target type of the scaler. If no metric type is provided then the AverageValue is used.
In v2.17 is a check in the webhook admission that if at least one trigger is of the type
AverageValue
, then having fallback is valid. AmetricType
is optional and often not supplied. As a result, many scaledObjects now give errors when supplying a fallback withoutmetricType
.Adding an extra check if the
trigger.MetricType
is empty will fix this issue. This check is also in the scaler.go.Any feedback regarding the chosen solution is okay.
Checklist
Fixes #6696