Skip to content

Commit

Permalink
adjust preconditions to properly skip unlabeled pods
Browse files Browse the repository at this point in the history
Signed-off-by: Indrranil Pawar <[email protected]>
  • Loading branch information
Indrranil committed Dec 17, 2024
1 parent 884c3a4 commit 59cd794
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ spec:
rules:
- name: add-donot-disrupt-label
match:
any:
- resources:
kinds:
- Pod
resources:
kinds:
- Pod
preconditions:
all:
- key: '{{request.object.metadata.labels."karpenter.sh/do-not-evict"}}'
operator: Equals
value: "true"
- key: '{{ request.object.metadata.labels."karpenter.sh/do-not-evict" || '''' }}'
operator: NotEquals
value: ""
mutate:
patchStrategicMerge:
metadata:
labels:
"karpenter.sh/do-not-disrupt": "true"
karpenter.sh/do-not-disrupt: "true"

0 comments on commit 59cd794

Please sign in to comment.