From cc957e2c6ef35b8bbcf1771b5603d670d11a02b9 Mon Sep 17 00:00:00 2001 From: Vyankatesh Kudtarkar Date: Fri, 13 Aug 2021 14:08:18 +0530 Subject: [PATCH] fix issue --- pkg/policymutation/policymutation.go | 6 +++--- test/e2e/mutate/mutate_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/policymutation/policymutation.go b/pkg/policymutation/policymutation.go index ebdd7f31ad..cb3bd98af2 100644 --- a/pkg/policymutation/policymutation.go +++ b/pkg/policymutation/policymutation.go @@ -112,13 +112,13 @@ func checkForGVKFormatPatch(policy *kyverno.ClusterPolicy, log logr.Logger) (pat func getFormatedKind(str string) (kind string) { if strings.Count(str, "/") == 0 { - return strings.Title(strings.ToLower(str)) + return strings.Title(str) } splitString := strings.Split(str, "/") if strings.Count(str, "/") == 1 { - return splitString[0] + "/" + strings.Title(strings.ToLower(splitString[1])) + return splitString[0] + "/" + strings.Title(splitString[1]) } - return splitString[0] + "/" + splitString[1] + "/" + strings.Title(strings.ToLower(splitString[2])) + return splitString[0] + "/" + splitString[1] + "/" + strings.Title(splitString[2]) } func convertPatchToJSON6902(policy *kyverno.ClusterPolicy, log logr.Logger) (patches [][]byte, errs []error) { diff --git a/test/e2e/mutate/mutate_test.go b/test/e2e/mutate/mutate_test.go index b8eadd67e9..368578dc63 100644 --- a/test/e2e/mutate/mutate_test.go +++ b/test/e2e/mutate/mutate_test.go @@ -107,7 +107,7 @@ func Test_Mutate_Sets(t *testing.T) { cmRes, err := e2eClient.GetNamespacedResource(cmGVR, tests.ResourceNamespace, "target") c, _ := json.Marshal(cmRes) - By(fmt.Sprintf("ConfigMap : %s", string(c))) + By(fmt.Sprintf("configMap : %s", string(c))) Expect(err).NotTo(HaveOccurred()) Expect(cmRes.GetLabels()["kyverno.key/copy-me"]).To(Equal("sample-value"))