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

feat(kustomize): Template paths #7049

Merged

Conversation

sberss
Copy link
Contributor

@sberss sberss commented Jan 24, 2022

Description

We have been using Skaffold to allow our developers to create ephemeral namespaces to test code changes within. We were partly able to get this to work by creating a pre-deploy hook that templates the namespace manifest via environment variables, however this has a limitation as you cannot manage multiple namespaces due to not being able to template the Kustomize path.

This PR introduces templating to the Kustomize path by calling the ExpandEnvTemplate utility function. An example project illustrating an example of this workflow can be seen here. With this PR you would be able to create and delete multiple namespaces by setting the NAMESPACE environment variable. The following set of commands would work in this repository if this PR was merged:

NAMESPACE=foo skaffold run
NAMESPACE=bar skaffold run
NAMESPACE=foo skaffold delete

@sberss sberss requested a review from a team as a code owner January 24, 2022 16:55
@codecov
Copy link

codecov bot commented Jan 29, 2022

Codecov Report

Merging #7049 (80be480) into main (290280e) will decrease coverage by 1.69%.
The diff coverage is 56.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7049      +/-   ##
==========================================
- Coverage   70.48%   68.78%   -1.70%     
==========================================
  Files         515      554      +39     
  Lines       23150    25874    +2724     
==========================================
+ Hits        16317    17798    +1481     
- Misses       5776     6867    +1091     
- Partials     1057     1209     +152     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/deploy.go 52.00% <ø> (-1.85%) ⬇️
cmd/skaffold/app/cmd/dev.go 84.61% <0.00%> (ø)
cmd/skaffold/app/cmd/render.go 36.66% <0.00%> (-4.72%) ⬇️
cmd/skaffold/skaffold.go 0.00% <0.00%> (ø)
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 68.85% <40.00%> (-7.62%) ⬇️
cmd/skaffold/app/cmd/lint.go 42.85% <42.85%> (ø)
cmd/skaffold/app/cmd/find_configs.go 48.88% <50.00%> (+0.24%) ⬆️
cmd/skaffold/app/skaffold.go 76.19% <70.00%> (-8.43%) ⬇️
... and 184 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a045287...80be480. Read the comment docs.

@MarlonGamez MarlonGamez added the kokoro:run runs the kokoro jobs on a PR label Jan 31, 2022
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Jan 31, 2022
@aaron-prindle
Copy link
Contributor

Sorry for the review delay. Just looked through, LGTM! Thanks for the PR!

@aaron-prindle aaron-prindle merged commit 70d9efa into GoogleContainerTools:main Feb 1, 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.

None yet

4 participants