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

Add Helm 3 UpgradeRelease #1421

Merged
merged 4 commits into from
Jan 9, 2020

Conversation

SimonAlling
Copy link
Contributor

Description of the change

This PR implements UpgradeRelease using the Helm 3 API.

Benefits

  • It will bring us one step closer to Helm 3 support.

Possible drawbacks

  • There are no tests yet.
  • OperateRelease only supports upgrading at the moment (but it will support testing and rolling back later).

Applicable issues

Additional information

The switch statement in handler.OperateRelease is currently redundant, but it will make sense when support for testing and rolling back is added (see its Tiller Proxy counterpart).

Copy link
Contributor

@andresmgot andresmgot left a 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

cmd/kubeops/internal/handler/handler.go Show resolved Hide resolved

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor Author

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?

@andresmgot andresmgot merged commit a7f9b5e into vmware-tanzu:master Jan 9, 2020
@SimonAlling SimonAlling deleted the helm3-upgrade-release branch January 9, 2020 14:54
@SimonAlling SimonAlling mentioned this pull request Jan 22, 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.

2 participants