-
Notifications
You must be signed in to change notification settings - Fork 40
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: guard cast of launchtemplate with type check #254
fix: guard cast of launchtemplate with type check #254
Conversation
Signed-off-by: Jonah Back <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #254 +/- ##
==========================================
- Coverage 87.82% 87.76% -0.07%
==========================================
Files 17 17
Lines 2251 2255 +4
==========================================
+ Hits 1977 1979 +2
- Misses 171 173 +2
Partials 103 103
Continue to review full report at Codecov.
|
|
||
status.SetActiveLaunchTemplateName(configName) | ||
status.SetLatestTemplateVersion(latestVersionString) | ||
switch scalingConfigType := (*scalingConfig).(type) { |
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.
So in this case spec.IsLaunchTemplate() is true because spec has changed to LaunchTemplate, but scalingConfig is not yet created? what does that mean for the rolling upgrade?
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.
It's more that the scalingConfig exists, but it's of type *scaling.LaunchConfig.
Just tested the rolling upgrade out - there's one small issue in that two CRs get submitted (with the default concurrency policy). One like rollup-vault-20210208201848-0
, and another like rollup-vault-20210208201848-1
. This is probably due to our defaulting the LaunchTemplate version to '0' if it's not set.
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.
We could probably just default it to 1 in the case that scalingConfig is of type *scaling.LaunchConfig
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.
What happens when we go from LaunchTemplate back to LaunchConfig?
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.
Great question - I haven't tried that case :) - though I don't think this PR would change it, since this is only running if type==LaunchTemplate. Let me check real quick though!
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.
LC -> LT works fine
Signed-off-by: Jonah Back <[email protected]>
Closes #253
Signed-off-by: Jonah Back [email protected]