Skip to content

Commit

Permalink
Update volumes.md
Browse files Browse the repository at this point in the history
Had a typo :( in the earlier PR - #45501. 
Test output - 

```
kubectl apply -f gitrepovol.yaml      
Warning: spec.volumes[1].gitRepo: deprecated in v1.11
The pods "gitrepo-volume-pod" is invalid: : ValidatingAdmissionPolicy 'deprecated-gitrepo-volumes.example.com' with binding 'deprecated-gitrepo-volumes-binding.example.com' denied request: Pod must not use deprecated spec.volumes[].gitRepo field.

kubectl get ValidatingAdmissionPolicy -oyaml  | grep 'expression'
    - expression: has(object.spec.volumes) && !object.spec.volumes.exists(v, has(v.gitRepo))
```
  • Loading branch information
SaranBalaji90 committed Apr 10, 2024
1 parent 2fed611 commit c94fa0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/en/docs/concepts/storage/volumes.md
Expand Up @@ -326,7 +326,7 @@ You can restrict the use of `gitRepo` volumes in your cluster using
[ValidatingAdmissionPolicy](/docs/reference/access-authn-authz/validating-admission-policy/).
You can use the following Common Expression Language (CEL) expression as
part of a policy to reject use of `gitRepo` volumes:
`!has(object.spec.volumes) || !object.spec.volumes.exists(v, has(v.gitRepo))`.
`has(object.spec.volumes) || !object.spec.volumes.exists(v, has(v.gitRepo))`.

{{< /warning >}}

Expand Down

0 comments on commit c94fa0c

Please sign in to comment.