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: deploy to multiple namespaces #8623

Merged

Conversation

gsquared94
Copy link
Collaborator

Fixes: b/266719200

Description
If the rendered manifest has multiple namespaces, retry kubectl create dry-run command without a namespace flag.

Testing instruction
See the added integration test.

@codecov
Copy link

codecov bot commented Apr 1, 2023

Codecov Report

Merging #8623 (5d19502) into main (290280e) will decrease coverage by 6.25%.
The diff coverage is 54.47%.

@@            Coverage Diff             @@
##             main    #8623      +/-   ##
==========================================
- Coverage   70.48%   64.23%   -6.25%     
==========================================
  Files         515      613      +98     
  Lines       23150    30708    +7558     
==========================================
+ Hits        16317    19725    +3408     
- Misses       5776     9503    +3727     
- 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 39 more

... and 392 files with indirect coverage changes

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

ARG SKAFFOLD_GO_GCFLAGS
RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -trimpath -o /app main.go

FROM alpine:3.10
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Alpine 3.10 is from ~2019, might make sense to use a more recent alpine version eg: 3.15+

ns, client := SetupNamespace(t.T)
ns2, _ := SetupNamespace(t.T)

_, _, fErr := replaceInFile("namespace1", ns.Name, fmt.Sprintf("%s/skaffold.yaml", "testdata/helm-multi-namespaces"))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might make sense to use a separate constant for the test data directory path instead of repeating "testdata/helm-multi-namespaces". Might make it easier to update the path if necessary in the future.

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!

@gsquared94 gsquared94 merged commit 3b5320c into GoogleContainerTools:main Apr 2, 2023
14 checks passed
@aaron-prindle aaron-prindle added this to the v2.3.1 milestone Apr 4, 2023
aaron-prindle pushed a commit that referenced this pull request May 15, 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

2 participants