Skip to content

Commit

Permalink
Merge pull request containers#8935 from giuseppe/conmon-keep-LC_
Browse files Browse the repository at this point in the history
oci: keep LC_ env variables to conmon
  • Loading branch information
openshift-merge-robot authored Jan 11, 2021
2 parents 3b987a7 + ae9dab9 commit d2503ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libpod/oci_conmon_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,12 @@ func prepareProcessExec(c *Container, options *ExecOptions, env []string, sessio
// configureConmonEnv gets the environment values to add to conmon's exec struct
// TODO this may want to be less hardcoded/more configurable in the future
func (r *ConmonOCIRuntime) configureConmonEnv(ctr *Container, runtimeDir string) ([]string, []*os.File) {
env := make([]string, 0, 6)
var env []string
for _, e := range os.Environ() {
if strings.HasPrefix(e, "LC_") {
env = append(env, e)
}
}
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 d2503ae

Please sign in to comment.