mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
fix issue
This commit is contained in:
parent
8e2033cc95
commit
cc957e2c6e
2 changed files with 4 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -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"))
|
||||
|
|
Loading…
Reference in a new issue