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

fix: properly update 'label' field for helm + render w/ -l flag #7349

Conversation

aaron-prindle
Copy link
Contributor

@aaron-prindle aaron-prindle commented Apr 28, 2022

Fixes #7336

Before this change:

aprindle@aprindle ~/skaffold/examples/helm-remote-repo  [fix-7336-add-label-helm-render]$ skaffold-v1.37.1 render --offline --digest-source=none --output=manifest.yaml -l=test=foo
--digest-source set to 'none', tags listed in Kubernetes manifests will be used for render
aprindle@aprindle ~/skaffold/examples/helm-remote-repo  [fix-7336-add-label-helm-render]$ cat manifest.yaml | grep foo
aprindle@aprindle ~/skaffold/examples/helm-remote-repo  [fix-7336-add-label-helm-render]$ 

After this change (the output shown is the change backported onto v1.37.1, currently there is no helm renderer in V2 IIUC. See - https://github.com/GoogleContainerTools/skaffold/blob/main/pkg/skaffold/render/renderer/noop/noop.go#L30):

aprindle@aprindle ~/skaffold/examples/helm-remote-repo  [fix-7336-add-label-helm-render]$ skaffold render --offline --digest-source=none --output=manifest.yaml -l=test=foo
--digest-source set to 'none', tags listed in Kubernetes manifests will be used for render
aprindle@aprindle ~/skaffold/examples/helm-remote-repo  [fix-7336-add-label-helm-render]$ cat manifest.yaml | grep foo
    test: foo
    test: foo
    test: foo
    test: foo
        test: foo
    test: foo
        test: foo

The changes for the V2 Helm -> Render method are nearly identical to what is done in V1. I understand in V2 this code is not used but the Helm deployer is TODO and IIUC likely re-using parts of the Render method will be done so it makes sense to get this in now so it will also be in the helm renderer implementation

@codecov
Copy link

codecov bot commented Apr 28, 2022

Codecov Report

Merging #7349 (a7664f3) into main (290280e) will decrease coverage by 3.17%.
The diff coverage is 56.35%.

@@            Coverage Diff             @@
##             main    #7349      +/-   ##
==========================================
- Coverage   70.48%   67.31%   -3.18%     
==========================================
  Files         515      556      +41     
  Lines       23150    26589    +3439     
==========================================
+ Hits        16317    17898    +1581     
- Misses       5776     7410    +1634     
- Partials     1057     1281     +224     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 50.00% <0.00%> (-3.85%) ⬇️
cmd/skaffold/app/cmd/test.go 44.44% <0.00%> (ø)
cmd/skaffold/skaffold.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/render.go 36.66% <12.50%> (-4.72%) ⬇️
cmd/skaffold/app/cmd/inspect_tests.go 62.50% <14.28%> (-1.14%) ⬇️
cmd/skaffold/app/cmd/lsp.go 28.12% <28.12%> (ø)
cmd/skaffold/app/cmd/fix.go 54.09% <38.88%> (-22.38%) ⬇️
cmd/skaffold/app/cmd/lint.go 42.85% <42.85%> (ø)
cmd/skaffold/app/cmd/find_configs.go 48.88% <46.15%> (+0.24%) ⬆️
... and 272 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Contributor

@MarlonGamez MarlonGamez left a comment

Choose a reason for hiding this comment

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

lgtm 👍🏼

@aaron-prindle aaron-prindle merged commit 9a672d6 into GoogleContainerTools:main Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

skaffold render does not include labels set with -l when using Helm
2 participants