Merge pull request #4657 from jdieter/fix-runtime-path-when-root

Return empty runtime directory if we're not rootless
This commit is contained in:
OpenShift Merge Robot
2019-12-07 14:48:25 -08:00
committed by GitHub

View File

@ -20,6 +20,10 @@ import (
func GetRuntimeDir() (string, error) {
var rootlessRuntimeDirError error
if !rootless.IsRootless() {
return "", nil
}
rootlessRuntimeDirOnce.Do(func() {
runtimeDir := os.Getenv("XDG_RUNTIME_DIR")
uid := fmt.Sprintf("%d", rootless.GetRootlessUID())