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:
parent
91a0615e7f
commit
4ec6fbac55
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue