Skip to content

Commit

Permalink
fix: Make defaultNamespace warning more useful (#9669)
Browse files Browse the repository at this point in the history
Previously warning was printed in any case of multiple `defaultNamespace`s. Now it only gets printed when there are actual different namespaces configured. Also mentions said namespaces.
  • Loading branch information
AndreasBergmeier6176 authored Jan 17, 2025
1 parent 7747647 commit dfb2b7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/skaffold/runner/runcontext/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ func (rc *RunContext) GetNamespace() string {
var defaultNamespace string
for _, p := range rc.GetPipelines() {
if p.Deploy.KubectlDeploy != nil && p.Deploy.KubectlDeploy.DefaultNamespace != nil {
if defaultNamespace != "" {
log.Entry(context.TODO()).Warn("multiple deploy.kubectl.defaultNamespace values set, only last pipeline's value will be used")
if defaultNamespace != "" && defaultNamespace != *p.Deploy.KubectlDeploy.DefaultNamespace {
log.Entry(context.TODO()).Warnf("multiple deploy.kubectl.defaultNamespace values set (%s, %s), only last pipeline's value will be used", defaultNamespace, *p.Deploy.KubectlDeploy.DefaultNamespace)
}
defaultNamespace = *p.Deploy.KubectlDeploy.DefaultNamespace
}
Expand Down

0 comments on commit dfb2b7f

Please sign in to comment.