summaryrefslogtreecommitdiff
path: root/pkg/util/utils_supported.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-02 22:03:19 +0100
committerGitHub <noreply@github.com>2020-12-02 22:03:19 +0100
commit7984842d7e55baa8fc9498afa23b62113850feac (patch)
tree45a9d09c0595ee11b7162c11836004b51a2c2aa4 /pkg/util/utils_supported.go
parente74072e742a427fbd8577fdc98daf1133cf13c48 (diff)
parentab886328357184cd0a8375a5dedf816ba91789f9 (diff)
downloadpodman-7984842d7e55baa8fc9498afa23b62113850feac.tar.gz
podman-7984842d7e55baa8fc9498afa23b62113850feac.tar.bz2
podman-7984842d7e55baa8fc9498afa23b62113850feac.zip
Merge pull request #8556 from mheon/fix_8539
Use Libpod tmpdir for pause path
Diffstat (limited to 'pkg/util/utils_supported.go')
-rw-r--r--pkg/util/utils_supported.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkg/util/utils_supported.go b/pkg/util/utils_supported.go
index 2d636a7cb..a63c76415 100644
--- a/pkg/util/utils_supported.go
+++ b/pkg/util/utils_supported.go
@@ -99,7 +99,8 @@ func GetRootlessConfigHomeDir() (string, error) {
}
// GetRootlessPauseProcessPidPath returns the path to the file that holds the pid for
-// the pause process
+// the pause process.
+// DEPRECATED - switch to GetRootlessPauseProcessPidPathGivenDir
func GetRootlessPauseProcessPidPath() (string, error) {
runtimeDir, err := GetRuntimeDir()
if err != nil {
@@ -107,3 +108,13 @@ func GetRootlessPauseProcessPidPath() (string, error) {
}
return filepath.Join(runtimeDir, "libpod", "pause.pid"), nil
}
+
+// GetRootlessPauseProcessPidPathGivenDir returns the path to the file that
+// holds the PID of the pause process, given the location of Libpod's temporary
+// files.
+func GetRootlessPauseProcessPidPathGivenDir(libpodTmpDir string) (string, error) {
+ if libpodTmpDir == "" {
+ return "", errors.Errorf("must provide non-empty tmporary directory")
+ }
+ return filepath.Join(libpodTmpDir, "pause.pid"), nil
+}