diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-08-31 14:46:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-31 14:46:10 -0400 |
commit | f947ea2d5fc84ac579d4bb13a66fb699500da7f4 (patch) | |
tree | 0b9db1b2da78eaf53ddfee4f973798eb8939bb72 /libpod/container_internal_linux.go | |
parent | 8ab84b437352bf2b3653fe92fbfa60a59b980a93 (diff) | |
parent | 10144b707ece4533e332a18fbb6ae7ca23d771ac (diff) | |
download | podman-f947ea2d5fc84ac579d4bb13a66fb699500da7f4.tar.gz podman-f947ea2d5fc84ac579d4bb13a66fb699500da7f4.tar.bz2 podman-f947ea2d5fc84ac579d4bb13a66fb699500da7f4.zip |
Merge pull request #11316 from vrothberg/fix-10443
pass LISTEN_* environment into container
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r-- | libpod/container_internal_linux.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index b624f44ac..847122929 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -773,6 +773,18 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) { } } + // Pass down the LISTEN_* environment (see #10443). + for _, key := range []string{"LISTEN_PID", "LISTEN_FDS", "LISTEN_FDNAMES"} { + if val, ok := os.LookupEnv(key); ok { + // Force the PID to `1` since we cannot rely on (all + // versions of) all runtimes to do it for us. + if key == "LISTEN_PID" { + val = "1" + } + g.AddProcessEnv(key, val) + } + } + return g.Config, nil } |