Add guard to the validating admission policy to stop errors when there are no volumes in the spec. This fixes errors with HTTP solver pods in cert manager. (#706)
Signed-off-by: Oliver Bassett <[email protected]> Co-authored-by: kfox1111 <[email protected]>
This commit is contained in:
co-authored by
kfox1111
parent
1e1e8daa69
commit
dfbbecf077
@@ -17,6 +17,7 @@ spec:
|
|||||||
resources: ["pods"]
|
resources: ["pods"]
|
||||||
validations:
|
validations:
|
||||||
- expression: |
|
- expression: |
|
||||||
|
!has(object.spec.volumes) ||
|
||||||
!object.spec.volumes.exists(c, has(c.csi) && has(c.csi.driver) && c.csi.driver == {{ .Values.pluginName | quote }})
|
!object.spec.volumes.exists(c, has(c.csi) && has(c.csi.driver) && c.csi.driver == {{ .Values.pluginName | quote }})
|
||||||
message: 'you may not use the upstream.csi.spiffe.io csi driver'
|
message: 'you may not use the upstream.csi.spiffe.io csi driver'
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user