Skip to content

Commit

Permalink
Merge pull request kubernetes#122126 from liggitt/duplicate-warning
Browse files Browse the repository at this point in the history
Update duplicate env var warning
  • Loading branch information
k8s-ci-robot authored Dec 19, 2023
2 parents 42ab3b7 + b6e3418 commit b5ba7bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/api/pod/warnings.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func warningsForPodSpecAndMeta(fieldPath *field.Path, podSpec *api.PodSpec, meta
bad = true
}
if bad {
warnings = append(warnings, fmt.Sprintf("%s: hides previous definition of %q", p.Child("env").Index(i), item.Name))
warnings = append(warnings, fmt.Sprintf("%s: hides previous definition of %q, which may be dropped when using apply", p.Child("env").Index(i), item.Name))
}
} else {
items.Insert(item.Name)
Expand Down
20 changes: 10 additions & 10 deletions pkg/api/pod/warnings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,16 @@ func TestWarnings(t *testing.T) {
}}},
}},
expected: []string{
`spec.initContainers[0].env[1]: hides previous definition of "a"`,
`spec.initContainers[0].env[2]: hides previous definition of "a"`,
`spec.initContainers[0].env[3]: hides previous definition of "a"`,
`spec.initContainers[0].env[4]: hides previous definition of "a"`,
`spec.initContainers[0].env[5]: hides previous definition of "a"`,
`spec.containers[0].env[1]: hides previous definition of "b"`,
`spec.containers[0].env[2]: hides previous definition of "b"`,
`spec.containers[0].env[3]: hides previous definition of "b"`,
`spec.containers[0].env[4]: hides previous definition of "b"`,
`spec.containers[0].env[5]: hides previous definition of "b"`,
`spec.initContainers[0].env[1]: hides previous definition of "a", which may be dropped when using apply`,
`spec.initContainers[0].env[2]: hides previous definition of "a", which may be dropped when using apply`,
`spec.initContainers[0].env[3]: hides previous definition of "a", which may be dropped when using apply`,
`spec.initContainers[0].env[4]: hides previous definition of "a", which may be dropped when using apply`,
`spec.initContainers[0].env[5]: hides previous definition of "a", which may be dropped when using apply`,
`spec.containers[0].env[1]: hides previous definition of "b", which may be dropped when using apply`,
`spec.containers[0].env[2]: hides previous definition of "b", which may be dropped when using apply`,
`spec.containers[0].env[3]: hides previous definition of "b", which may be dropped when using apply`,
`spec.containers[0].env[4]: hides previous definition of "b", which may be dropped when using apply`,
`spec.containers[0].env[5]: hides previous definition of "b", which may be dropped when using apply`,
},
},
{
Expand Down

0 comments on commit b5ba7bc

Please sign in to comment.