mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 06:43:54 +00:00
Merge pull request #122126 from liggitt/duplicate-warning
Update duplicate env var warning
This commit is contained in:
commit
b5ba7bc4f5
@ -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)
|
||||
|
@ -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`,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user