-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add error and event for mismatching input property #6763
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: zhenghanzhou <[email protected]>
Signed-off-by: zhenghanzhou <[email protected]>
Signed-off-by: zhenghanzhou <[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.
Generally LGTM, just a small nit though
message := fmt.Sprintf("Unmatched input property %s in scaler %s", key+suffix, sc.ScalableObjectType) | ||
// Just logging as it's optional property checking and should not block the scaling | ||
logger.Error(nil, message) | ||
sc.Recorder.Event(sc.ScaledObject, corev1.EventTypeNormal, eventreason.KEDAScalersInfo, message) |
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.
Should we use corev1.EventTypeWarning
instead of corev1.EventTypeNormal
here?
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.
I could see a good rationale for either type. My usual rule of thumb is
- use
Normal
when something successfully happened and a user should know about it - e.g. volume is mounted, some connection was established... - use
Warning
when something unexpected happened and it has negative impact for the user - e.g. volume didn't get mounted, some connection got broken...
This case "an extra parameter user provided is ignored". KEDA is successful at ignoring it but it might have unexpected result for the user, so a bit of both. I'd probably also pick Warning
event but I can be easily convinced for Normal
.
/run-e2e |
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, thank you!
Maybe the event type deserves a little bit of discussion as mentioned here by @dttung2905 but I'm happy with either result of the discussion.
Signed-off-by: Zhenghan Zhou <[email protected]>
/run-e2e |
Provide a description of what has been changed
Checklist
Fixes #
Relates to # #6721