summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-14 18:55:49 +0000
committerGitHub <noreply@github.com>2022-06-14 18:55:49 +0000
commit4018a9575e616ebcb3e5232c5d7c81ad6cadfc99 (patch)
tree590b5e49c1009cc6601a2856e3229965395fb3d6 /libpod
parenta22e270ef62efafa598978b179afa22dc0813101 (diff)
parentfcfcd4cdb1b19fe00f6769f33e6704a7f8700d40 (diff)
downloadpodman-4018a9575e616ebcb3e5232c5d7c81ad6cadfc99.tar.gz
podman-4018a9575e616ebcb3e5232c5d7c81ad6cadfc99.tar.bz2
podman-4018a9575e616ebcb3e5232c5d7c81ad6cadfc99.zip
Merge pull request #14582 from giuseppe/no-create-containerenv-if-run-volume
container: do not create .containerenv with -v SRC:/run
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal_linux.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 41c0ac595..eafe3d75e 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -2249,8 +2249,19 @@ func (c *Container) makeBindMounts() error {
}
}
+ _, hasRunContainerenv := c.state.BindMounts["/run/.containerenv"]
+ if !hasRunContainerenv {
+ // check in the spec mounts
+ for _, m := range c.config.Spec.Mounts {
+ if m.Destination == "/run/.containerenv" || m.Destination == "/run" {
+ hasRunContainerenv = true
+ break
+ }
+ }
+ }
+
// Make .containerenv if it does not exist
- if _, ok := c.state.BindMounts["/run/.containerenv"]; !ok {
+ if !hasRunContainerenv {
containerenv := c.runtime.graphRootMountedFlag(c.config.Spec.Mounts)
isRootless := 0
if rootless.IsRootless() {