Skip to content
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 autoscale when dry-run in set #845

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

jorgemarey
Copy link
Contributor

Autoscaler tries to scale even when dry-run is configured. This happens when the current count is out of the range of the configured min/max. Currently the dry-run check is performed after this checks are executed.

return w.scaleTarget(logger, target, eval.Policy, action, currentStatus)

This PR moves the dry-run check to inside the scaleTarget method so every scaling action goes through the check.

Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jorgemarey!

I have a vague memory of maybe doing this on purpose to always enforce the min/max values, but thinking about it again it doesn't make sense to bypass the dry-run mode.

@lgfa29 lgfa29 merged commit 147c6be into hashicorp:main Feb 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants