File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
content/en/docs/concepts/storage Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -311,9 +311,23 @@ third party storage driver instead.
311
311
# ## gitRepo (deprecated) {#gitrepo}
312
312
313
313
{{< warning >}}
314
- The `gitRepo` volume type is deprecated. To provision a container with a git repo, mount an
315
- [EmptyDir](#emptydir) into an InitContainer that clones the repo using git, then mount the
314
+ The `gitRepo` volume type is deprecated.
315
+
316
+ To provision a Pod that has a Git repository mounted, you can
317
+ mount an
318
+ [`emptyDir`](#emptydir) volume into an [init container](/docs/concepts/workloads/pods/init-containers/) that
319
+ clones the repo using Git, then mount the
316
320
[EmptyDir](#emptydir) into the Pod's container.
321
+
322
+ ---
323
+
324
+ You can restrict the use of `gitRepo` volumes in your cluster using
325
+ [policies](/docs/concepts/policy/) such as
326
+ [ValidatingAdmissionPolicy](/docs/reference/access-authn-authz/validating-admission-policy/).
327
+ You can use the following Common Expression Language (CEL) expression as
328
+ part of a policy to reject use of `gitRepo` volumes :
329
+ ` !has(object.spec.volumes) || !object.spec.volumes.exists(v, has(v.gitRepo))` .
330
+
317
331
{{< /warning >}}
318
332
319
333
A `gitRepo` volume is an example of a volume plugin. This plugin
You can’t perform that action at this time.
0 commit comments