diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-05-31 14:53:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 14:53:35 +0200 |
commit | 60b372b49b53ef4fccb16a366e7133a861143612 (patch) | |
tree | 40e47f9091b1c17edd79d9f8af506c8f5d6b2695 /pkg/systemd/generate/containers.go | |
parent | c1c18039dca2d0967082e63935c2052cd089570a (diff) | |
parent | 53072184192e9952daa3a84bc6f55c15e9ea352e (diff) | |
download | podman-60b372b49b53ef4fccb16a366e7133a861143612.tar.gz podman-60b372b49b53ef4fccb16a366e7133a861143612.tar.bz2 podman-60b372b49b53ef4fccb16a366e7133a861143612.zip |
Merge pull request #10506 from vrothberg/fix-10493
generate systemd: make mounts portable
Diffstat (limited to 'pkg/systemd/generate/containers.go')
-rw-r--r-- | pkg/systemd/generate/containers.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/pkg/systemd/generate/containers.go b/pkg/systemd/generate/containers.go index eb1fb67ff..72f321347 100644 --- a/pkg/systemd/generate/containers.go +++ b/pkg/systemd/generate/containers.go @@ -152,14 +152,14 @@ func generateContainerInfo(ctr *libpod.Container, options entities.GenerateSyste return nil, errors.Errorf("could not determine storage store for container") } - graphRoot := store.GraphRoot() - if graphRoot == "" { - return nil, errors.Errorf("could not lookup container's graphroot: got empty string") - } - - runRoot := store.RunRoot() - if runRoot == "" { - return nil, errors.Errorf("could not lookup container's runroot: got empty string") + var runRoot string + if options.New { + runRoot = "%t/containers" + } else { + runRoot = store.RunRoot() + if runRoot == "" { + return nil, errors.Errorf("could not lookup container's runroot: got empty string") + } } envs := config.Spec.Process.Env @@ -172,7 +172,6 @@ func generateContainerInfo(ctr *libpod.Container, options entities.GenerateSyste StopTimeout: timeout, GenerateTimestamp: true, CreateCommand: createCommand, - GraphRoot: graphRoot, RunRoot: runRoot, containerEnv: envs, } |