mirror of
https://github.com/containers/podman.git
synced 2025-06-23 18:59:30 +08:00
Include more environment variables in conmon env.
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 <kenny@macdermid.ca>
This commit is contained in:
@ -1221,10 +1221,15 @@ func (r *ConmonOCIRuntime) configureConmonEnv(runtimeDir string) []string {
|
|||||||
env = append(env, e)
|
env = append(env, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
conf, ok := os.LookupEnv("CONTAINERS_CONF")
|
if path, ok := os.LookupEnv("PATH"); ok {
|
||||||
if 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))
|
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("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_USERNS_CONFIGURED=%s", os.Getenv("_CONTAINERS_USERNS_CONFIGURED")))
|
||||||
env = append(env, fmt.Sprintf("_CONTAINERS_ROOTLESS_UID=%s", os.Getenv("_CONTAINERS_ROOTLESS_UID")))
|
env = append(env, fmt.Sprintf("_CONTAINERS_ROOTLESS_UID=%s", os.Getenv("_CONTAINERS_ROOTLESS_UID")))
|
||||||
|
Reference in New Issue
Block a user