Skip to content

Commit 4ec6fba

Browse files
Fix errors on ValidatingAdmissionPolicyBindings for the CEL for Admission Control blog & doc (#38893)
* Fix errors on ValidatingAdmissionPolicyBindings for the CEL for Admission Control blog * Fix namespaceSelector error * Fix namespaceSelector errors
1 parent 91a0615 commit 4ec6fba

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

content/en/blog/_posts/2022-12-20-validating-admission-policies-alpha/index.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ kind: ValidatingAdmissionPolicyBinding
6060
metadata:
6161
name: "demo-binding-test.example.com"
6262
spec:
63-
policy: "demo-policy.example.com"
63+
policyName: "demo-policy.example.com"
6464
matchResources:
6565
namespaceSelector:
66-
- key: environment,
67-
operator: In,
68-
values: ["test"]
66+
matchExpressions:
67+
- key: environment
68+
operator: In
69+
values:
70+
- test
6971
```
7072

7173
This `ValidatingAdmissionPolicyBinding` resource binds the above policy only to
@@ -115,14 +117,16 @@ kind: ValidatingAdmissionPolicyBinding
115117
metadata:
116118
name: "demo-binding-production.example.com"
117119
spec:
118-
policy: "demo-policy.example.com"
119-
paramsRef:
120+
policyName: "demo-policy.example.com"
121+
paramRef:
120122
name: "demo-params-production.example.com"
121123
matchResources:
122124
namespaceSelector:
123-
- key: environment,
124-
operator: In,
125-
values: ["production"]
125+
matchExpressions:
126+
- key: environment
127+
operator: In
128+
values:
129+
- production
126130
```
127131

128132
```yaml

content/en/docs/reference/access-authn-authz/validating-admission-policy.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ spec:
193193
matchResources:
194194
namespaceSelector:
195195
matchExpressions:
196-
- key: environment,
197-
operator: NotIn,
198-
values: ["test"]
196+
- key: environment
197+
operator: NotIn
198+
values:
199+
- test
199200
```
200201

201202
And have a parameter resource like:
@@ -222,7 +223,7 @@ spec:
222223
matchResources:
223224
namespaceSelector:
224225
matchExpressions:
225-
- key: environment,
226+
- key: environment
226227
operator: Exists
227228
```
228229

0 commit comments

Comments
 (0)