Don't replace pod annotations in variable expansion test

This change fixes the "Variable Expansion should verify that a failing subpath
expansion can be modified during the lifecycle of a container" conformance test
where the annotations are replaced with those used by the test, instead of
appending them.

This may cause undesirable side-effects with other controllers that may be
using pod annotations.
This commit is contained in:
Chaitanya Bandi 2021-03-24 12:31:19 -07:00
parent fcee7a0105
commit 0681a44672

View File

@ -267,7 +267,10 @@ var _ = SIGDescribe("Variable Expansion", func() {
ginkgo.By("updating the pod")
podClient.Update(pod.ObjectMeta.Name, func(pod *v1.Pod) {
pod.ObjectMeta.Annotations = map[string]string{"mysubpath": "mypath"}
if pod.ObjectMeta.Annotations == nil {
pod.ObjectMeta.Annotations = make(map[string]string)
}
pod.ObjectMeta.Annotations["mysubpath"] = "mypath"
})
ginkgo.By("waiting for pod running")