-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(helm): handle templated namespaces consistently #6767
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(helm): handle templated namespaces consistently #6767
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6767 +/- ##
==========================================
- Coverage 70.48% 69.54% -0.94%
==========================================
Files 515 536 +21
Lines 23150 24419 +1269
==========================================
+ Hits 16317 16982 +665
- Misses 5776 6308 +532
- Partials 1057 1129 +72
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to test this?
Either some unit tests or manual testing notes could help. |
@@ -69,7 +70,11 @@ func collectHelmReleasesNamespaces(pipelines []latestV1.Pipeline) []string { | |||
if cfg.Deploy.HelmDeploy != nil { | |||
for _, release := range cfg.Deploy.HelmDeploy.Releases { | |||
if release.Namespace != "" { | |||
namespaces = append(namespaces, release.Namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the same approach as in releaseNamespace()
, and it should surface any errors back up.
https://github.com/GoogleContainerTools/skaffold/blob/main/pkg/skaffold/deploy/helm/util.go#L159-L164
Some unit tests of |
8aadfd0
to
8edbc56
Compare
I've added the suggested changes and unit test for
is acceptable as theree was a suggested edit made that was essentially:
but I'm a bit confused as this is what I believe should be an error case given the context. Thanks. |
8edbc56
to
7dcbf4b
Compare
7dcbf4b
to
c268445
Compare
I was wrong with my comment. It happens more often than I'd like :-) The important thing is that we treat inputs uniformly. It would seem to make sense to have |
I'm not sure I understand, I believe the logic for namespace gathering from pipelines done in
which is essentially |
Currently I believe the implementation and tests are sufficient, was there any concern around better re-use of logic for |
We have |
fixes #6749
Currently if there is a templated namespace with helm that does not currently exist in the cluster, skaffold will fail even though a regular deploy would succeed. As mentioned in #6749, this is because currently skaffold fetches the namespaces before we template which results in this failure. The fix here is to template the helm namespaces before fetching them.