diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-12 10:33:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-12 10:33:18 +0200 |
commit | 6f3e7f7eccdfed03d3d617a9040d5e0b844ea637 (patch) | |
tree | 2632afdbee8c1f480ae515453161b65d89866d69 /cmd/podman/shared/create.go | |
parent | 20f11718def2a5bf5af96363e9c7082ba48077f4 (diff) | |
parent | 369f8b8862e8918a011290311e44c1691f699c58 (diff) | |
download | podman-6f3e7f7eccdfed03d3d617a9040d5e0b844ea637.tar.gz podman-6f3e7f7eccdfed03d3d617a9040d5e0b844ea637.tar.bz2 podman-6f3e7f7eccdfed03d3d617a9040d5e0b844ea637.zip |
Merge pull request #3557 from rhatdan/env
Add support for --env-host
Diffstat (limited to 'cmd/podman/shared/create.go')
-rw-r--r-- | cmd/podman/shared/create.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index 60a01ff6d..be1a731cc 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -482,6 +482,16 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. // ENVIRONMENT VARIABLES env := EnvVariablesFromData(data) + if c.Bool("env-host") { + for _, e := range os.Environ() { + pair := strings.SplitN(e, "=", 2) + if _, ok := env[pair[0]]; !ok { + if len(pair) > 1 { + env[pair[0]] = pair[1] + } + } + } + } if err := parse.ReadKVStrings(env, c.StringSlice("env-file"), c.StringArray("env")); err != nil { return nil, errors.Wrapf(err, "unable to process environment variables") } |