From df452ad46863702d3a86726b976973618cd4b6a7 Mon Sep 17 00:00:00 2001 From: Vishal Choudhary Date: Mon, 9 Sep 2024 12:39:41 +0530 Subject: [PATCH] fix: restrict-node-label-changes chainsaw test (#1153) * fix: restrict-node-label-changes chainsaw test Signed-off-by: Vishal Choudhary * fix: chainsaw tests Signed-off-by: Vishal Choudhary * fix: lint Signed-off-by: Vishal Choudhary --------- Signed-off-by: Vishal Choudhary --- other/restrict-node-label-changes/artifacthub-pkg.yml | 2 +- .../restrict-node-label-changes.yaml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/other/restrict-node-label-changes/artifacthub-pkg.yml b/other/restrict-node-label-changes/artifacthub-pkg.yml index 56618f392..0c728ca59 100644 --- a/other/restrict-node-label-changes/artifacthub-pkg.yml +++ b/other/restrict-node-label-changes/artifacthub-pkg.yml @@ -18,4 +18,4 @@ readme: | annotations: kyverno/category: "Sample" kyverno/subject: "Node, Label" -digest: 5f85ca279377a987568daa4353191e8e843ed6e708ffc9a4163e0fd95ec27894 +digest: 38106c8df0ccdaf9ae63887c117672b7eda38149160fa30d112dff26fa76fcc9 diff --git a/other/restrict-node-label-changes/restrict-node-label-changes.yaml b/other/restrict-node-label-changes/restrict-node-label-changes.yaml index f0f2b2655..3d77260f5 100644 --- a/other/restrict-node-label-changes/restrict-node-label-changes.yaml +++ b/other/restrict-node-label-changes/restrict-node-label-changes.yaml @@ -26,6 +26,7 @@ spec: kinds: - Node validate: + allowExistingViolations: false message: "Modifying the `foo` label on a Node is not allowed." deny: conditions: @@ -51,8 +52,9 @@ spec: operator: Equals value: "?*" validate: + allowExistingViolations: false message: "Removing the `foo` label on a Node is not allowed." pattern: metadata: labels: - foo: "*" \ No newline at end of file + foo: "*"