mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
Update duplicate env var warning
This commit is contained in:
parent
ad9b60e2c9
commit
b6e34187ca
@ -257,7 +257,7 @@ func warningsForPodSpecAndMeta(fieldPath *field.Path, podSpec *api.PodSpec, meta
|
|||||||
bad = true
|
bad = true
|
||||||
}
|
}
|
||||||
if bad {
|
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 {
|
} else {
|
||||||
items.Insert(item.Name)
|
items.Insert(item.Name)
|
||||||
|
@ -296,16 +296,16 @@ func TestWarnings(t *testing.T) {
|
|||||||
}}},
|
}}},
|
||||||
}},
|
}},
|
||||||
expected: []string{
|
expected: []string{
|
||||||
`spec.initContainers[0].env[1]: hides previous definition of "a"`,
|
`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"`,
|
`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"`,
|
`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"`,
|
`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"`,
|
`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"`,
|
`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"`,
|
`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"`,
|
`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"`,
|
`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"`,
|
`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