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

plugin: fix bug in ext. strategy plugins suggesting scale to zero. #122

Merged
merged 1 commit into from
May 12, 2020

Conversation

jrasell
Copy link
Member

@jrasell jrasell commented May 11, 2020

The way in which stdlib encoding/gob works means a pointer to a
types default value will result in the RPC translation becoming
nil. This meant external strategy plugins were not able to suggest
scaling to zero, as the pointer to zero would be translated to nil
which inturn is classed as dry-run.

This change removes the use of a pointer for count within strategy
action struct. Allowing the use of zero to indicate scaling to
zero. Dry run situations use a special -1 count field, to indicate
a dry run workflow should be triggered.

closes #83

The way in which stdlib encoding/gob works means a pointer to a
types default value will result in the RPC translation becoming
nil. This meant external strategy plugins were not able to suggest
scaling to zero, as the pointer to zero would be translated to nil
which inturn is classed as dry-run.

This change removes the use of a pointer for count within strategy
action struct. Allowing the use of zero to indicate scaling to
zero. Dry run situations use a special -1 count field, to indicate
a dry run workflow should be triggered.
@jrasell jrasell added this to the 0.0.2 milestone May 11, 2020
@jrasell jrasell requested review from lgfa29, jazzyfresh and cgbaker May 11, 2020 13:53
@jrasell jrasell self-assigned this May 11, 2020
Copy link
Contributor

@cgbaker cgbaker left a comment

Choose a reason for hiding this comment

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

looks good. implicitly, -1 would have been a no-op anyway, because it would be capped by policy.Min, so it makes me feel a little better about a magic number instead of a new dryrun field.

@jrasell jrasell merged commit 5d6afd7 into master May 12, 2020
@jrasell jrasell deleted the b-gh-83 branch May 12, 2020 15:03
jrasell added a commit that referenced this pull request May 12, 2020
jrasell added a commit that referenced this pull request May 12, 2020
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.

[bug] external strategy plugins unable to suggest scaling to zero
3 participants