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
This commit is contained in:
Mathieu Benoit 2023-01-12 11:38:54 -05:00 committed by GitHub
parent 91a0615e7f
commit 4ec6fbac55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 13 deletions

View File

@ -60,12 +60,14 @@ kind: ValidatingAdmissionPolicyBinding
metadata: metadata:
name: "demo-binding-test.example.com" name: "demo-binding-test.example.com"
spec: spec:
policy: "demo-policy.example.com" policyName: "demo-policy.example.com"
matchResources: matchResources:
namespaceSelector: namespaceSelector:
- key: environment, matchExpressions:
operator: In, - key: environment
values: ["test"] operator: In
values:
- test
``` ```
This `ValidatingAdmissionPolicyBinding` resource binds the above policy only to This `ValidatingAdmissionPolicyBinding` resource binds the above policy only to
@ -115,14 +117,16 @@ kind: ValidatingAdmissionPolicyBinding
metadata: metadata:
name: "demo-binding-production.example.com" name: "demo-binding-production.example.com"
spec: spec:
policy: "demo-policy.example.com" policyName: "demo-policy.example.com"
paramsRef: paramRef:
name: "demo-params-production.example.com" name: "demo-params-production.example.com"
matchResources: matchResources:
namespaceSelector: namespaceSelector:
- key: environment, matchExpressions:
operator: In, - key: environment
values: ["production"] operator: In
values:
- production
``` ```
```yaml ```yaml

View File

@ -193,9 +193,10 @@ spec:
matchResources: matchResources:
namespaceSelector: namespaceSelector:
matchExpressions: matchExpressions:
- key: environment, - key: environment
operator: NotIn, operator: NotIn
values: ["test"] values:
- test
``` ```
And have a parameter resource like: And have a parameter resource like:
@ -222,7 +223,7 @@ spec:
matchResources: matchResources:
namespaceSelector: namespaceSelector:
matchExpressions: matchExpressions:
- key: environment, - key: environment
operator: Exists operator: Exists
``` ```