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: skaffold render namespace regression in v2 #8482

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

gsquared94
Copy link
Collaborator

@gsquared94 gsquared94 commented Mar 1, 2023

Fixes: b/265799040

Description

From helm/helm#3553 helm template command run with the --namespace flag doesn't set the metadata.namespace in the rendered manifests but only sets {{.Release.Namespace}} templates. In Skaffold v1, the deploy.helm.releases[i].namespace property was also being passed as the --namespace flag for a skaffold apply command. To preserve this behavior in v2 when upgrading from an old config, the upgrade logic is changed to duplicate the deploy.helm.releases to manifests.helm.releases. So we can use the helm release namespace values again in the skaffold apply command.

@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #8482 (9a49100) into main (290280e) will decrease coverage by 5.28%.
The diff coverage is 55.02%.

@@            Coverage Diff             @@
##             main    #8482      +/-   ##
==========================================
- Coverage   70.48%   65.20%   -5.28%     
==========================================
  Files         515      602      +87     
  Lines       23150    29912    +6762     
==========================================
+ Hits        16317    19505    +3188     
- Misses       5776     8937    +3161     
- Partials     1057     1470     +413     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/completion.go 13.04% <0.00%> (-1.25%) ⬇️
cmd/skaffold/app/cmd/config/list.go 65.21% <ø> (ø)
cmd/skaffold/app/cmd/config/set.go 88.72% <ø> (ø)
cmd/skaffold/app/cmd/config/util.go 54.28% <ø> (ø)
cmd/skaffold/app/cmd/credits.go 100.00% <ø> (ø)
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/generate_pipeline.go 60.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_modules.go 65.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_profiles.go 66.66% <ø> (ø)
... and 425 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@aaron-prindle aaron-prindle 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
Copy link
Contributor

LGTM, only thing that might make sense is to add a validation/error for if the namespaces are different between manifests.* and deploy.* , add an error but don't have a strong opinion.

Copy link
Contributor

@renzodavid9 renzodavid9 left a comment

Choose a reason for hiding this comment

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

LGTM! We should create an issue to create an integration test for this case. I can create it if you'd like

@gsquared94 gsquared94 merged commit e5a8ea9 into GoogleContainerTools:main Mar 2, 2023
aaron-prindle pushed a commit that referenced this pull request Mar 2, 2023
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.

None yet

3 participants