Merge pull request #22608 from giuseppe/use-pause-process-dir-for-root

util: specify a not empty pause dir for root too
This commit is contained in:
openshift-merge-bot[bot]
2024-05-06 14:23:47 +00:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@ -28,7 +28,7 @@ func GetRootlessConfigHomeDir() (string, error) {
// GetRootlessPauseProcessPidPath returns the path to the file that holds the pid for
// the pause process.
func GetRootlessPauseProcessPidPath() (string, error) {
runtimeDir, err := GetRootlessRuntimeDir()
runtimeDir, err := homedir.GetRuntimeDir()
if err != nil {
return "", err
}

View File

@ -764,3 +764,9 @@ func TestProcessOptions(t *testing.T) {
})
}
}
func TestGetRootlessPauseProcessPidPath(t *testing.T) {
dir, err := GetRootlessPauseProcessPidPath()
assert.NoError(t, err)
assert.NotEqual(t, dir, "libpod/tmp/pause.pid")
}