-
Notifications
You must be signed in to change notification settings - Fork 706
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 Helm 3 UpgradeRelease #1421
Add Helm 3 UpgradeRelease #1421
Conversation
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, thanks! I just have two small suggestions
|
||
func upgradeRelease(cfg agent.Config, w http.ResponseWriter, req *http.Request, params handlerutil.Params) { | ||
releaseName := params[nameParam] | ||
chartDetails, chartMulti, err := handlerutil.ParseAndGetChart(req, cfg.ChartClient, requireV1Support) |
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.
here requireV1Support
is a bit of a readability issue. It seems that it's requiring v1 support. It would more readable if the var is called requireV2Support
but it may be confusing if its value is false
. Maybe notRequireV1Support
?
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.
I was bugged by the exact same thought! But what do? Wouldn't it be just as confusing to write const dontRequireV1Support = false
? Or would a comment suffice to mitigate that confusion?
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.
yes, a comment when setting the variable would be enough in my opinion
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.
I felt naming the variable dontRequireV1Support
or similar would make the code WET, since it would tie the constant name very closely to its value. I've renamed it to isV1SupportRequired
instead; WDYT?
Description of the change
This PR implements
UpgradeRelease
using the Helm 3 API.Benefits
Possible drawbacks
OperateRelease
only supports upgrading at the moment (but it will support testing and rolling back later).Applicable issues
Additional information
The
switch
statement inhandler.OperateRelease
is currently redundant, but it will make sense when support for testing and rolling back is added (see its Tiller Proxy counterpart).