-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix: panic in datadog scaler #3617
Conversation
da26354
to
228965f
Compare
/run-e2e datadog* |
Not sure if we should take the last point with a value (as proposed in this patch) or just return an error (or the filler value) if the last point has no value. |
To be consistent with the already existing behaviour, could you just return an error (or the fill value)? I mean, avoiding the panic but returning 0 or fill value like in other errors Tomorrow we will do a hotfix release, and I'd like to include this PR if you have time to change the code today |
Signed-off-by: Valentin Flaux <vflaux@oui.sncf>
228965f
to
6762b32
Compare
/run-e2e datadog* |
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.
Thanks a ton! ❤️
Signed-off-by: Valentin Flaux <vflaux@oui.sncf> Signed-off-by: Valentin Flaux <vflaux@oui.sncf>
In getQueryResult(), check if the last point as a value before dereferencing it.
In the datadog scaler, returns the value of the last point with a value instead of the value of the last point.This fixes a panic when the last point has a nil value when we try to dereference it.
Also moves duplicated code used when no metric can be found to a dedicated function.Checklist
Fixe #3448