diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-03-08 11:12:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-08 11:12:25 -0800 |
commit | b3d9540b1621954b63a2db8e53a38b572aadb067 (patch) | |
tree | d0a985134dba87da6d9b0d229e399844a3e39a5f /cmd/podman | |
parent | bf8c2096d8bba5d94a6e6201ba483f2aa72f1d01 (diff) | |
parent | 24f567a3db68efe67273b63cd50a003f0b6c5621 (diff) | |
download | podman-b3d9540b1621954b63a2db8e53a38b572aadb067.tar.gz podman-b3d9540b1621954b63a2db8e53a38b572aadb067.tar.bz2 podman-b3d9540b1621954b63a2db8e53a38b572aadb067.zip |
Merge pull request #2589 from baude/issue2171
container runlabel respect $PWD
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/shared/container.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/shared/container.go b/cmd/podman/shared/container.go index 81811e0f2..e191e8069 100644 --- a/cmd/podman/shared/container.go +++ b/cmd/podman/shared/container.go @@ -665,6 +665,14 @@ func GenerateRunlabelCommand(runLabel, imageName, name string, opts map[string]s return envmap["OPT2"] case "OPT3": return envmap["OPT3"] + case "PWD": + // I would prefer to use os.getenv but it appears PWD is not in the os env list + d, err := os.Getwd() + if err != nil { + logrus.Error("unable to determine current working directory") + return "" + } + return d } return "" } |