Skip to content

Commit 14e6a13

Browse files
committed
Fix multus webhook match condition for spec changes
Update the CreateDeleteOrUpdatedSpec match condition to properly handle cases where spec field is removed or added. Signed-off-by: Patryk Diak <[email protected]>
1 parent 5c08dc8 commit 14e6a13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bindata/network/multus-admission-controller/003-webhook.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ webhooks:
3030
matchConditions:
3131
# On updates, only validate if the Spec changes
3232
- name: CreateDeleteOrUpdatedSpec
33-
expression: oldObject == null || object == null || object.spec != oldObject.spec
33+
expression: oldObject == null || object == null || has(object.spec) != has(oldObject.spec) || (has(object.spec) && object.spec != oldObject.spec)
3434
sideEffects: NoneOnDryRun
3535
admissionReviewVersions:
3636
- v1

0 commit comments

Comments
 (0)