From c113c41c9cc63ed8d08b440de5bc49ce5eabd790 Mon Sep 17 00:00:00 2001 From: jregan Date: Mon, 28 Dec 2020 09:53:34 -0800 Subject: [PATCH] Regression coverage for configmap generation. --- api/krusty/configmaps_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/api/krusty/configmaps_test.go b/api/krusty/configmaps_test.go index 5736206c8..7fa15ce46 100644 --- a/api/krusty/configmaps_test.go +++ b/api/krusty/configmaps_test.go @@ -258,6 +258,37 @@ metadata: `) } +func TestIssue3393(t *testing.T) { + th := kusttest_test.MakeHarness(t) + th.WriteK(".", ` +resources: +- cm.yaml +configMapGenerator: + - name: project + behavior: merge + literals: + - ANOTHER_ENV_VARIABLE="bar" +`) + th.WriteF("cm.yaml", ` +apiVersion: v1 +kind: ConfigMap +metadata: + name: project +data: + A_FIRST_ENV_VARIABLE: "foo" +`) + m := th.Run(".", th.MakeDefaultOptions()) + th.AssertActualEqualsExpected(m, ` +apiVersion: v1 +data: + A_FIRST_ENV_VARIABLE: foo + ANOTHER_ENV_VARIABLE: bar +kind: ConfigMap +metadata: + name: project +`) +} + func TestGeneratorSimpleOverlay(t *testing.T) { th := kusttest_test.MakeHarness(t) th.WriteK("base", `