Skip to content

fix: not inject metadata.namespace in manifests rendered with kustomize#8409

Merged
aaron-prindle merged 3 commits intoGoogleContainerTools:mainfrom
renzodavid9:issue-8403
Feb 14, 2023
Merged

fix: not inject metadata.namespace in manifests rendered with kustomize#8409
aaron-prindle merged 3 commits intoGoogleContainerTools:mainfrom
renzodavid9:issue-8403

Conversation

@renzodavid9
Copy link
Copy Markdown
Contributor

@renzodavid9 renzodavid9 commented Feb 6, 2023

Fixes: #8403

Description
This is to to fix a v1 regression: manifests rendered with kustomize shouldn't have a metadata.namespace field injected by skaffold.

A new InjectNamespace property is added to decide if Skaffold should inject a namespace by itself or not. For 8318 we can use this new property, reading its value from a flag or configuration.

Follow-up Work
8318

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 6, 2023

Codecov Report

Merging #8409 (58165d1) into main (290280e) will decrease coverage by 5.36%.
The diff coverage is 55.02%.

@@            Coverage Diff             @@
##             main    #8409      +/-   ##
==========================================
- Coverage   70.48%   65.13%   -5.36%     
==========================================
  Files         515      609      +94     
  Lines       23150    30178    +7028     
==========================================
+ Hits        16317    19656    +3339     
- Misses       5776     9042    +3266     
- Partials     1057     1480     +423     
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 420 more

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

manifests, err := g.Generate(rCtx, out)
// TODO(https://github.com/GoogleContainerTools/skaffold/issues/8318): revisit this code to better tackle this case for kustomize.
// We could have a different renderer for kustomize that doesn't inject namespaces.
kustomizeManifests, otherManifests, err := g.Generate(rCtx, out)
Copy link
Copy Markdown
Contributor

@aaron-prindle aaron-prindle Feb 6, 2023

Choose a reason for hiding this comment

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

NOTE: @ericzzzzzzz has added a seperate kustomize renderer in his WIP PR here:
#8365

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes! 😄 with it we can tackle this case better.

@renzodavid9 renzodavid9 marked this pull request as ready for review February 6, 2023 20:37
@renzodavid9 renzodavid9 requested review from a team and tejal29 and removed request for a team February 6, 2023 20:39
@aaron-prindle
Copy link
Copy Markdown
Contributor

@renzodavid9 Seems this needs a rebase now after merging #8365

@renzodavid9
Copy link
Copy Markdown
Contributor Author

@renzodavid9 Seems this needs a rebase now after merging #8365

Done! I rebased with the latest changes and changed the code to tackle this. Let me know what do you think.

Copy link
Copy Markdown
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 aaron-prindle merged commit 4c9c341 into GoogleContainerTools:main Feb 14, 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.

[Regression] meta.namespace added in manifests using kustomize renderer

3 participants