Skip to content

Commit

Permalink
Include more environment variables in conmon env.
Browse files Browse the repository at this point in the history
Include the path and helper binary dir so that the podman
environment more closely matches when conmon calls it as an
exit command.

Also match the CONTAINERS_CONF lookup to the codestyle of other
environment lookups.

[NO NEW TESTS NEEDED]

Resolves #15707

Signed-off-by: Kenny MacDermid <[email protected]>
  • Loading branch information
KenMacD committed Sep 11, 2022
1 parent eb78947 commit 6091ff4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libpod/oci_conmon_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1221,10 +1221,15 @@ func (r *ConmonOCIRuntime) configureConmonEnv(runtimeDir string) []string {
env = append(env, e)
}
}
conf, ok := os.LookupEnv("CONTAINERS_CONF")
if ok {
if path, ok := os.LookupEnv("PATH"); ok {
env = append(env, fmt.Sprintf("PATH=%s", path))
}
if conf, ok := os.LookupEnv("CONTAINERS_CONF"); ok {
env = append(env, fmt.Sprintf("CONTAINERS_CONF=%s", conf))
}
if conf, ok := os.LookupEnv("CONTAINERS_HELPER_BINARY_DIR"); ok {
env = append(env, fmt.Sprintf("CONTAINERS_HELPER_BINARY_DIR=%s", conf))
}
env = append(env, fmt.Sprintf("XDG_RUNTIME_DIR=%s", runtimeDir))
env = append(env, fmt.Sprintf("_CONTAINERS_USERNS_CONFIGURED=%s", os.Getenv("_CONTAINERS_USERNS_CONFIGURED")))
env = append(env, fmt.Sprintf("_CONTAINERS_ROOTLESS_UID=%s", os.Getenv("_CONTAINERS_ROOTLESS_UID")))
Expand Down

0 comments on commit 6091ff4

Please sign in to comment.