aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-09-16 12:08:30 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2021-09-16 20:17:38 +0200
commitfa9728c5509f1ef3bb1c80055e89b910d9740efd (patch)
tree5ff502ebeac54aa6bb42c5257e5cdfcfc4b359e3 /pkg
parent9119a578e782b92bd344f093f5491c318bc20d69 (diff)
downloadpodman-fa9728c5509f1ef3bb1c80055e89b910d9740efd.tar.gz
podman-fa9728c5509f1ef3bb1c80055e89b910d9740efd.tar.bz2
podman-fa9728c5509f1ef3bb1c80055e89b910d9740efd.zip
system: avoid reading pause pid file
we already know the path to the pause PID file, no need to calculate it again. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/infra/abi/system.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go
index bc98edd06..0f7492354 100644
--- a/pkg/domain/infra/abi/system.go
+++ b/pkg/domain/infra/abi/system.go
@@ -12,7 +12,6 @@ import (
"strings"
"github.com/containers/common/pkg/config"
- "github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/cgroups"
"github.com/containers/podman/v3/pkg/domain/entities"
@@ -121,7 +120,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool)
became, ret, err = rootless.TryJoinFromFilePaths(pausePidPath, true, paths)
- if err := movePauseProcessToScope(ic.Libpod); err != nil {
+ if err := movePauseProcessToScope(pausePidPath); err != nil {
conf, err2 := ic.Config(context.Background())
if err2 != nil {
return err
@@ -142,15 +141,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool)
return nil
}
-func movePauseProcessToScope(r *libpod.Runtime) error {
- tmpDir, err := r.TmpDir()
- if err != nil {
- return err
- }
- pausePidPath, err := util.GetRootlessPauseProcessPidPathGivenDir(tmpDir)
- if err != nil {
- return errors.Wrapf(err, "could not get pause process pid file path")
- }
+func movePauseProcessToScope(pausePidPath string) error {
data, err := ioutil.ReadFile(pausePidPath)
if err != nil {
return errors.Wrapf(err, "cannot read pause pid file")