From 0681a446720fd45e5ce0c07e37cbc8b42783882d Mon Sep 17 00:00:00 2001 From: Chaitanya Bandi Date: Wed, 24 Mar 2021 12:31:19 -0700 Subject: [PATCH] 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. --- test/e2e/common/node/expansion.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/common/node/expansion.go b/test/e2e/common/node/expansion.go index c0c2af2d9ba..05ed90e6c18 100644 --- a/test/e2e/common/node/expansion.go +++ b/test/e2e/common/node/expansion.go @@ -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")