-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): add replace expressions for validating admission poli…
…cy patch (#489) add replace expressions for validating admission policy patch Signed-off-by: yaroslavborbat <[email protected]>
- Loading branch information
1 parent
a8be806
commit 41c916f
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
images/virt-artifact/patches/023-replace-expressions-for-validating-admission-policy.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/pkg/virt-operator/resource/generate/components/validatingadmissionpolicy.go b/pkg/virt-operator/resource/generate/components/validatingadmissionpolicy.go | ||
index 5fefec2304..20914e8bf6 100644 | ||
--- a/pkg/virt-operator/resource/generate/components/validatingadmissionpolicy.go | ||
+++ b/pkg/virt-operator/resource/generate/components/validatingadmissionpolicy.go | ||
@@ -117,7 +117,7 @@ func NewHandlerV1ValidatingAdmissionPolicy(virtHandlerServiceAccount string) *ad | ||
Variables: []admissionregistrationv1.Variable{ | ||
{ | ||
Name: "oldNonKubevirtLabels", | ||
- Expression: `oldObject.metadata.labels.filter(k, !k.contains("kubevirt.io") && k != "cpumanager")`, | ||
+ Expression: `oldObject.metadata.labels.filter(k, !k.contains("kubevirt") && k != "cpumanager")`, | ||
}, | ||
{ | ||
Name: "oldLabels", | ||
@@ -125,7 +125,7 @@ func NewHandlerV1ValidatingAdmissionPolicy(virtHandlerServiceAccount string) *ad | ||
}, | ||
{ | ||
Name: "newNonKubevirtLabels", | ||
- Expression: `object.metadata.labels.filter(k, !k.contains("kubevirt.io") && k != "cpumanager")`, | ||
+ Expression: `object.metadata.labels.filter(k, !k.contains("kubevirt") && k != "cpumanager")`, | ||
}, | ||
{ | ||
Name: "newLabels", | ||
@@ -133,11 +133,11 @@ func NewHandlerV1ValidatingAdmissionPolicy(virtHandlerServiceAccount string) *ad | ||
}, | ||
{ | ||
Name: "oldNonKubevirtAnnotations", | ||
- Expression: `oldObject.metadata.annotations.filter(k, !k.contains("kubevirt.io"))`, | ||
+ Expression: `oldObject.metadata.annotations.filter(k, !k.contains("kubevirt"))`, | ||
}, | ||
{ | ||
Name: "newNonKubevirtAnnotations", | ||
- Expression: `object.metadata.annotations.filter(k, !k.contains("kubevirt.io"))`, | ||
+ Expression: `object.metadata.annotations.filter(k, !k.contains("kubevirt"))`, | ||
}, | ||
{ | ||
Name: "oldAnnotations", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters