File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed
blog/_posts/2022-12-20-validating-admission-policies-alpha
docs/reference/access-authn-authz Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -60,12 +60,14 @@ kind: ValidatingAdmissionPolicyBinding
60
60
metadata:
61
61
name: "demo-binding-test.example.com"
62
62
spec:
63
- policy : "demo-policy.example.com"
63
+ policyName : "demo-policy.example.com"
64
64
matchResources:
65
65
namespaceSelector:
66
- - key: environment,
67
- operator: In,
68
- values: ["test"]
66
+ matchExpressions:
67
+ - key: environment
68
+ operator: In
69
+ values:
70
+ - test
69
71
` ` `
70
72
71
73
This `ValidatingAdmissionPolicyBinding` resource binds the above policy only to
@@ -115,14 +117,16 @@ kind: ValidatingAdmissionPolicyBinding
115
117
metadata:
116
118
name: "demo-binding-production.example.com"
117
119
spec:
118
- policy : "demo-policy.example.com"
119
- paramsRef :
120
+ policyName : "demo-policy.example.com"
121
+ paramRef :
120
122
name: "demo-params-production.example.com"
121
123
matchResources:
122
124
namespaceSelector:
123
- - key: environment,
124
- operator: In,
125
- values: ["production"]
125
+ matchExpressions:
126
+ - key: environment
127
+ operator: In
128
+ values:
129
+ - production
126
130
` ` `
127
131
128
132
` ` ` yaml
Original file line number Diff line number Diff line change @@ -193,9 +193,10 @@ spec:
193
193
matchResources:
194
194
namespaceSelector:
195
195
matchExpressions:
196
- - key: environment,
197
- operator: NotIn,
198
- values: ["test"]
196
+ - key: environment
197
+ operator: NotIn
198
+ values:
199
+ - test
199
200
` ` `
200
201
201
202
And have a parameter resource like :
@@ -222,7 +223,7 @@ spec:
222
223
matchResources:
223
224
namespaceSelector:
224
225
matchExpressions:
225
- - key: environment,
226
+ - key: environment
226
227
operator: Exists
227
228
` ` `
228
229
You can’t perform that action at this time.
0 commit comments