Skip to content

Commit

Permalink
fix: restrict-node-label-changes chainsaw test
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
  • Loading branch information
vishal-chdhry committed Sep 8, 2024
1 parent e4787c5 commit f3a67d2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
- resources:
kinds:
- Node
operations:
- UPDATE
validate:
message: "Modifying the `foo` label on a Node is not allowed."
deny:
Expand All @@ -42,11 +44,10 @@ spec:
- resources:
kinds:
- Node
operations:
- UPDATE
preconditions:
all:
- key: "{{ request.operation || 'BACKGROUND' }}"
operator: Equals
value: UPDATE
- key: "{{ request.oldObject.metadata.labels.foo || '' }}"
operator: Equals
value: "?*"
Expand All @@ -55,4 +56,4 @@ spec:
pattern:
metadata:
labels:
foo: "*"
foo: "*"

0 comments on commit f3a67d2

Please sign in to comment.