1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-30 19:35:06 +00:00

fix finalizers mutation with patchesJson6902 (#5132)

* fix finalizers mutation with patchesJson6902

Signed-off-by: Danny Kulchinsky <dkulchinsky@fastly.com>
This commit is contained in:
Danny Kulchinsky 2022-10-25 02:34:07 -04:00 committed by GitHub
parent 8eb1d3988c
commit a3e2a20a23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -139,7 +139,8 @@ func ignorePatch(path string) bool {
!strings.Contains(path, "/metadata/namespace") &&
!strings.Contains(path, "/metadata/annotations") &&
!strings.Contains(path, "/metadata/labels") &&
!strings.Contains(path, "/metadata/ownerReferences") {
!strings.Contains(path, "/metadata/ownerReferences") &&
!strings.Contains(path, "/metadata/finalizers") {
return true
}
}

View file

@ -169,6 +169,14 @@ func Test_ignorePath(t *testing.T) {
path: "/metadata/labels",
ignore: false,
},
{
path: "/metadata/ownerReferences",
ignore: false,
},
{
path: "/metadata/finalizers",
ignore: false,
},
{
path: "/metadata/creationTimestamp",
ignore: true,