From 4d59146e48305d2de677ffb7100a5dc621953d39 Mon Sep 17 00:00:00 2001 From: natasha41575 Date: Thu, 14 Oct 2021 18:13:49 -0700 Subject: [PATCH] test for dropped quote in configmap generation --- api/krusty/configmaps_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/api/krusty/configmaps_test.go b/api/krusty/configmaps_test.go index 024d8ffb8..f2333b889 100644 --- a/api/krusty/configmaps_test.go +++ b/api/krusty/configmaps_test.go @@ -549,3 +549,27 @@ metadata: name: testing-tt4769fb52 `) } + +func TestDataEndsWithQuotes(t *testing.T) { + th := kusttest_test.MakeHarness(t) + th.WriteK(".", ` +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +configMapGenerator: + - name: test + literals: + - TEST=this is a 'test' +`) + + m := th.Run(".", th.MakeDefaultOptions()) + // The annotations are sorted by key, hence the order change. + // Quotes are added intentionally. + th.AssertActualEqualsExpected( + m, `apiVersion: v1 +data: + TEST: this is a 'test +kind: ConfigMap +metadata: + name: test-k7hhfb697g +`) +}