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

Remote helm charts should not be upgraded by default #3274

Merged

Conversation

dahovey
Copy link
Contributor

@dahovey dahovey commented Nov 20, 2019

Fixes #2245.

Description

Adds config to HelmRelease upgradeOnChange.

User facing changes

Remote helm charts will NOT be upgraded by default.

Before

Remote helm charts would always be upgraded on local file changes.

After

By default, remote helm charts will not be upgraded on local file changes. User will need to add upgradeOnChange: true to any remote charts that need to be upgraded on changes.

Next PRs.

n/a

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Mentions any output changes.
  • Adds documentation as needed: user docs, YAML reference, CLI reference.
  • Adds integration tests if needed.

Reviewer Notes

  • The code flow looks good.
  • Unit test added.
  • User facing changes look good.

Release Notes

- Remote helm charts are not upgraded by default. Added `upgradeOnChange` property to override.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@codecov
Copy link

codecov bot commented Nov 20, 2019

Codecov Report

Merging #3274 into master will increase coverage by 0.00%.
The diff coverage is 57.14%.

Impacted Files Coverage Δ
pkg/skaffold/schema/latest/config.go 100.00% <ø> (ø)
pkg/skaffold/deploy/helm.go 79.83% <57.14%> (-0.44%) ⬇️
...affold/kubernetes/portforward/kubectl_forwarder.go 63.41% <0.00%> (+2.43%) ⬆️

@dahovey
Copy link
Contributor Author

dahovey commented Nov 20, 2019

@googlebot I signed it!

pkg/skaffold/schema/latest/config.go Outdated Show resolved Hide resolved
@@ -204,6 +204,9 @@ func (h *HelmDeployer) deployRelease(ctx context.Context, out io.Writer, r lates
if !isInstalled {
args = append(args, "install", "--name", releaseName)
args = append(args, h.Flags.Install...)
} else if !h.shouldUpgradeOnChange(r) {
logrus.Infof("Release %s already installed...\n", releaseName)
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we should handle and log remote separately?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry not sure exactly what you mean. I am open to anything just needed the main feature of not upgrading remote charts.

Do you want more logging to indicate why the chart wasn't upgraded?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I missed this :-( Yes, more logging: since we're changing behaviour, it would be worth including why and what can be done.

@briandealwis
Copy link
Member

@dahovey the CLA bot doesn't have a record for you. Could you please try again?

@dahovey
Copy link
Contributor Author

dahovey commented Nov 27, 2019

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@dahovey
Copy link
Contributor Author

dahovey commented Dec 16, 2019

@briandealwis Could you clarify what you mean by 'handle' remote separately?

@dgageot
Copy link
Contributor

dgageot commented Jan 15, 2020

@briandealwis could you please take another look?

Copy link
Member

@briandealwis briandealwis left a comment

Choose a reason for hiding this comment

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

A little more logging, otherwise LGTM.

@@ -204,6 +204,9 @@ func (h *HelmDeployer) deployRelease(ctx context.Context, out io.Writer, r lates
if !isInstalled {
args = append(args, "install", "--name", releaseName)
args = append(args, h.Flags.Install...)
} else if !h.shouldUpgradeOnChange(r) {
logrus.Infof("Release %s already installed...\n", releaseName)
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I missed this :-( Yes, more logging: since we're changing behaviour, it would be worth including why and what can be done.

@dahovey
Copy link
Contributor Author

dahovey commented Feb 18, 2020

I think I need some help with this. On my first attempt with this feature the schema had already been updated, but now when I tried to run ./hack/new_version.sh after running tests I got all sorts of new errors that seem to be unrelated to the updates I made.

I did add more logging when upgradeOnChange is not set and based upon remote value.

Copy link
Member

@briandealwis briandealwis left a comment

Choose a reason for hiding this comment

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

Sorry @dahovey for the delay. If you merge with HEAD and resolve the conflict, your PR should be much smaller now.

pkg/skaffold/deploy/helm.go Outdated Show resolved Hide resolved
pkg/skaffold/schema/latest/config.go Outdated Show resolved Hide resolved
@nkubala
Copy link
Contributor

nkubala commented Mar 16, 2020

@dahovey sorry this kinda fizzled out, that's on us. would you mind quickly rebasing and regenerating the schema docs so that they're updating the correct version? let me know if you need any help with that.

@jtag05
Copy link

jtag05 commented Mar 26, 2020

@dahovey is there anything I can do to assist to get this ready to merge?

@dgageot
Copy link
Contributor

dgageot commented Apr 14, 2020

@dahovey this just needs a rebase and I'll merge it

@jtag05
Copy link

jtag05 commented Apr 18, 2020

@dgageot would it be possible for someone else to pick this up? I'd be happy to refork if @dahovey isn't available to push this across the finish line.

@dahovey
Copy link
Contributor Author

dahovey commented Apr 21, 2020

Hi all, I apologize for the delay.

I got a whole lot of failures running make test, but I've merged current changes and refactored based on helm.go changes

@nkubala
Copy link
Contributor

nkubala commented Apr 22, 2020

@dahovey sorry to hear you ran into issues with the tests. I see a few things looking at the failures in travis:

  • since this fell a bit behind, we released a new config version since you sent this PR. you'll need to move your config changes to the latest config file (v2beta3)
  • looks like a compile error in pkg/skaffold/deploy/helm_test.go (the unit test)
  • the schemas are out of date because your changes fell behind the current schema. once you make your changes, run make schemas to generate the new ones and commit that

we run make test directly in CI, so running this locally you should be able to catch all these errors. let me know if you're having other issues with running this directly and I'll try and help.

@tstromberg
Copy link
Contributor

@dahovey - need any help getting this PR pushed through?

@dahovey
Copy link
Contributor Author

dahovey commented May 8, 2020

@tstromberg @nkubala Could one of you please help resolve this error? It is received when running make or make install.

E0508 11:50:00.044868   20910 library.go:108] Failed to find license for github.com/docker/go-metrics: no file/directory matching regexp "^(LICEN(S|C)E|COPYING|README|NOTICE)(\\.(txt|md))?$" found for /Users/davidhovey/go/src/github.com/dahovey/skaffold/vendor/github.com/docker/go-metrics
Error: one or more libraries have an incompatible/unknown license: map["unknown":["github.com/docker/go-metrics"]]

@dahovey
Copy link
Contributor Author

dahovey commented May 8, 2020

I bumped schema version to v2beta4. I believe I am very close. Right now it appears checks failed, but the deploy test is passing.

Before the tests were refactored I believe I had it setup correctly to test that upgrade or install were not called. I couldn't figure out how to test whether a command was not called. Let me know any other changes needed.

Thanks for your patience.

@nkubala
Copy link
Contributor

nkubala commented May 21, 2020

@dahovey that error you were getting comes from the go-licenses tool we use to calculate our licenses, which we really don't need to be doing on local builds....you can try doing a which licenses or which go-licenses and if you have any binaries delete them, then let skaffold install, otherwise if you can't make it work you can remove the generate-statik target from your Makefile. sorry this is so painful.

unfortunately this keeps falling behind on our release cadence so the schema version needs to keep getting bumped, but I'll do everything I can to make sure this gets merged in the next week and a half before our next release. would you mind doing one last rebase?

@briandealwis
Copy link
Member

We just merged the version bump to v2beta5.

@dahovey dahovey requested a review from tstromberg as a code owner May 27, 2020 18:48
@dahovey
Copy link
Contributor Author

dahovey commented May 27, 2020

@briandealwis @nkubala Thanks for your patience. This has been a learning experience. Hope everything looks better.

I still couldn't resolve the licensing error. I ran which for go-licenses and licenses but no results. I had to remove the generate-statik target

@briandealwis briandealwis added the kokoro:run runs the kokoro jobs on a PR label May 29, 2020
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label May 29, 2020
@briandealwis briandealwis merged commit 6b744d5 into GoogleContainerTools:master May 29, 2020
@briandealwis
Copy link
Member

Thanks @dahovey!

@briandealwis briandealwis changed the title Added config to HelmRelease Remote helm charts should not be upgraded by default May 29, 2020
@nkubala
Copy link
Contributor

nkubala commented May 29, 2020

yes! awesome to see this one finally go in! thanks @dahovey for all your patience here, I think we've also learned a thing or two about staying on top of our reviews to make sure things don't fall behind because of us. hopefully your next contribution is a lot less painful 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remote helm chart shouldn't be upgraded on code changes
9 participants