Skip to content

Commit 77a4688

Browse files
SaranBalaji90Tim Bannister
andauthored
Update content/en/docs/concepts/storage/volumes.md
Co-authored-by: Tim Bannister <[email protected]>
1 parent 92045ae commit 77a4688

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

content/en/docs/concepts/storage/volumes.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,13 @@ The `gitRepo` volume type is deprecated. To provision a container with a git rep
313313
[EmptyDir](#emptydir) into the Pod's container.
314314

315315
---
316-
You can restrict the use of `gitRepo` volumes in your cluster using [policies](https://kubernetes.io/docs/concepts/policy/) like [ValidatingAdmissionPolicy](docs/reference/access-authn-authz/validating-admission-policy/). For example, following Common Expression Language (CEL) expression can be used to restrict pods that uses `gitRepo` volumes: `has(object.spec.volumes) && !object.spec.volumes.exists(v, has(v.gitRepo))`.
316+
317+
You can restrict the use of `gitRepo` volumes in your cluster using
318+
[policies](/docs/concepts/policy/) such as
319+
[ValidatingAdmissionPolicy](/docs/reference/access-authn-authz/validating-admission-policy/).
320+
Here is an example of a Common Expression Language (CEL) expression that you can use as
321+
part of a policy to reject use of `gitRepo` volumes:
322+
`!has(object.spec.volumes) || !object.spec.volumes.exists(v, has(v.gitRepo))`.
317323

318324
{{< /warning >}}
319325

0 commit comments

Comments
 (0)