From 62c5eabd0f9c4c9793b287c6f916b1ca36cc7cc2 Mon Sep 17 00:00:00 2001 From: Tarun Pothulapati Date: Tue, 13 Aug 2019 12:03:02 +0530 Subject: [PATCH] use different namespace for override tests Signed-off-by: Tarun Pothulapati --- test/inject/inject_test.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/test/inject/inject_test.go b/test/inject/inject_test.go index 4d2aeb2a788a5..14d506352d20c 100644 --- a/test/inject/inject_test.go +++ b/test/inject/inject_test.go @@ -98,16 +98,17 @@ func TestNamespaceOverrideAnnotations(t *testing.T) { t.Fatalf("failed to read inject test file: %s", err) } - injectNS := "inject-test" - deployName := "inject-test-namespace-override" - nsAnnotations := map[string]string{} - nsAnnotations[k8s.ProxyInjectAnnotation] = k8s.ProxyInjectEnabled - - // Namespace level proxy configuration override + injectNS := "inject-namespace-override-test" + deployName := "inject-namespace-override-test-terminus" nsInitImage := "test_init_image" nsProxyImage := "test_proxy_image" - nsAnnotations[k8s.ProxyInitImageAnnotation] = nsInitImage - nsAnnotations[k8s.ProxyImageAnnotation] = nsProxyImage + + // Namespace level proxy configuration override + nsAnnotations := map[string]string{ + k8s.ProxyInjectAnnotation: k8s.ProxyInjectEnabled, + k8s.ProxyInitImageAnnotation: nsInitImage, + k8s.ProxyImageAnnotation: nsProxyImage, + } ns := TestHelper.GetTestNamespace(injectNS) err = TestHelper.CreateNamespaceIfNotExists(ns, nsAnnotations) @@ -116,11 +117,11 @@ func TestNamespaceOverrideAnnotations(t *testing.T) { } // patch injectYAML with unique name and pod annotations - podAnnotations := map[string]string{} - // Pod Level proxy configuration override podInitImage := "proxy_test_init_image" - podAnnotations[k8s.ProxyInitImageAnnotation] = podInitImage + podAnnotations := map[string]string{ + k8s.ProxyInitImageAnnotation: podInitImage, + } patchedYAML, err := patchDeploy(injectYAML, deployName, podAnnotations) if err != nil {