-
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
add ignoreNullValues for AWS CloudWatch Scaler #5635
add ignoreNullValues for AWS CloudWatch Scaler #5635
Conversation
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
13c0fec
to
53ea3fd
Compare
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
495c201
to
8e41311
Compare
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
584eba6
to
b0d4e84
Compare
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
I added end to end tests here for both minMetricValue and errorWhenNullValues to cover off both scenarios. I need to tidy them up a little, which ill do over the next few days. |
53fac56
to
0ef98c5
Compare
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
0ef98c5
to
0b61f97
Compare
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
68a1c71
to
0dc9b77
Compare
...calers/aws/aws_cloudwatch_min_value_null_values/aws_cloudwatch_min_value_null_values_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
Thanks! |
Signed-off-by: robpickerill <r.pickerill@gmail.com>
731d45c
to
2e76a9b
Compare
Fixed conflicts, this needs another e2e test run |
/run-e2e aws |
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.
@robpickerill there is also a problem in static checks
Fixed, all tests should pass now. I see e2e didn't run due to Azure cluster scaling actions failing, would it be easier for me to put the e2e tests in a different PR and unblock this PR? The unit tests here cover the error case for the scaler, but I wanted to add e2e to prove the backward compatibility for the change. Let me know what works best for you. |
Signed-off-by: robpickerill <r.pickerill@gmail.com>
48ccb91
to
43a2c3f
Compare
/run-e2e aws |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
/run-e2e aws |
Thanks Jorge, need anything else to merge this? |
Signed-off-by: Rob Pickerill <r.pickerill@gmail.com>
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! ❤️
Please address the docs comment and we are ready
Thanks Jorge, fixed up the docs, and merged main into here and docs, should be good to go now - thanks again! |
/run-e2e aws |
* add errorWhenMetricValueEmpty Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix golangci-lint Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * improve error message for empty results Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * add error when empty metric values to changelog Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * rename errorWhenMetricValuesEmpty -> errorWhenNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * use getParameterFromConfigV2 to read config for errorWhenNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * add e2e for error state for cw, and improve e2e for min values for cw Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * remove erroneous print statement Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * remove unused vars Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * rename errorWhenMetricValuesEmpty -> ignoreNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * move towards shared package for e2e aws Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * minMetricValue optionality based on ignoreNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fail fast Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * Update tests/scalers/aws/aws_cloudwatch_ignore_null_values_false/aws_cloudwatch_ignore_null_values_false_test.go Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * Apply suggestions from code review Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fail fast Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix broken new line Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix broken new lines Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * assert no scaling changes in e2e, and set false for required in minMetricValue Signed-off-by: robpickerill <r.pickerill@gmail.com> * fix ci checks Signed-off-by: robpickerill <r.pickerill@gmail.com> * Update tests/scalers/aws/aws_cloudwatch_min_metric_value/aws_cloudwatch_min_metric_value_test.go fix invalid check Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix merge conflicts Signed-off-by: robpickerill <r.pickerill@gmail.com> * fix e2e package names Signed-off-by: robpickerill <r.pickerill@gmail.com> --------- Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> Signed-off-by: robpickerill <r.pickerill@gmail.com> Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Fira Curie <fira42073@gmail.com>
* add errorWhenMetricValueEmpty Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix golangci-lint Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * improve error message for empty results Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * add error when empty metric values to changelog Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * rename errorWhenMetricValuesEmpty -> errorWhenNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * use getParameterFromConfigV2 to read config for errorWhenNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * add e2e for error state for cw, and improve e2e for min values for cw Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * remove erroneous print statement Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * remove unused vars Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * rename errorWhenMetricValuesEmpty -> ignoreNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * move towards shared package for e2e aws Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * minMetricValue optionality based on ignoreNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fail fast Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * Update tests/scalers/aws/aws_cloudwatch_ignore_null_values_false/aws_cloudwatch_ignore_null_values_false_test.go Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * Apply suggestions from code review Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fail fast Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix broken new line Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix broken new lines Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * assert no scaling changes in e2e, and set false for required in minMetricValue Signed-off-by: robpickerill <r.pickerill@gmail.com> * fix ci checks Signed-off-by: robpickerill <r.pickerill@gmail.com> * Update tests/scalers/aws/aws_cloudwatch_min_metric_value/aws_cloudwatch_min_metric_value_test.go fix invalid check Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix merge conflicts Signed-off-by: robpickerill <r.pickerill@gmail.com> * fix e2e package names Signed-off-by: robpickerill <r.pickerill@gmail.com> --------- Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> Signed-off-by: robpickerill <r.pickerill@gmail.com> Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
* add errorWhenMetricValueEmpty Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix golangci-lint Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * improve error message for empty results Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * add error when empty metric values to changelog Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * rename errorWhenMetricValuesEmpty -> errorWhenNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * use getParameterFromConfigV2 to read config for errorWhenNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * add e2e for error state for cw, and improve e2e for min values for cw Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * remove erroneous print statement Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * remove unused vars Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * rename errorWhenMetricValuesEmpty -> ignoreNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * move towards shared package for e2e aws Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * minMetricValue optionality based on ignoreNullValues Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fail fast Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * Update tests/scalers/aws/aws_cloudwatch_ignore_null_values_false/aws_cloudwatch_ignore_null_values_false_test.go Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * Apply suggestions from code review Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fail fast Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix broken new line Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix broken new lines Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * assert no scaling changes in e2e, and set false for required in minMetricValue Signed-off-by: robpickerill <r.pickerill@gmail.com> * fix ci checks Signed-off-by: robpickerill <r.pickerill@gmail.com> * Update tests/scalers/aws/aws_cloudwatch_min_metric_value/aws_cloudwatch_min_metric_value_test.go fix invalid check Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> * fix merge conflicts Signed-off-by: robpickerill <r.pickerill@gmail.com> * fix e2e package names Signed-off-by: robpickerill <r.pickerill@gmail.com> --------- Signed-off-by: Rob Pickerill <r.pickerill@gmail.com> Signed-off-by: robpickerill <r.pickerill@gmail.com> Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
This PR adds support for erroring the AWS Cloudwatch Scaler when the GetMetricData call returns an empty set of metrics, resulting in no scale-changing behaviour when no custom metrics are available during the Cloudwatch query window.
Checklist
Fixes #5352
Relates to: