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

View File

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