summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcdoern <cbdoer23@g.holycross.edu>2022-04-27 20:54:24 -0400
committercdoern <cbdoer23@g.holycross.edu>2022-04-28 12:42:23 -0400
commit64a368ba240e1249d4cd243242da2b7d2b27ff1b (patch)
treee8f3832c8d3fc01a21f076df1333d2bd65f5df78
parent78c66fb005b75afc4f69564dd40ba16af92cfa6a (diff)
downloadpodman-64a368ba240e1249d4cd243242da2b7d2b27ff1b.tar.gz
podman-64a368ba240e1249d4cd243242da2b7d2b27ff1b.tar.bz2
podman-64a368ba240e1249d4cd243242da2b7d2b27ff1b.zip
remove unused codepath for creating/running ctr in a pod
`pod.CgroupPath()` currently includes a codepath that is never accessed, which is supposed to start the infra ctr and obtain the cgroup path from there that is never necessary/safe because p.state.CgroupPath is never empty [NO NEW TESTS NEEDED] Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
-rw-r--r--libpod/pod.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/libpod/pod.go b/libpod/pod.go
index ed2d97b37..c0c981d39 100644
--- a/libpod/pod.go
+++ b/libpod/pod.go
@@ -1,7 +1,6 @@
package libpod
import (
- "context"
"fmt"
"sort"
"strings"
@@ -296,35 +295,9 @@ func (p *Pod) CgroupPath() (string, error) {
if err := p.updatePod(); err != nil {
return "", err
}
- if p.state.CgroupPath != "" {
- return p.state.CgroupPath, nil
- }
if p.state.InfraContainerID == "" {
return "", errors.Wrap(define.ErrNoSuchCtr, "pod has no infra container")
}
-
- id, err := p.infraContainerID()
- if err != nil {
- return "", err
- }
-
- if id != "" {
- ctr, err := p.infraContainer()
- if err != nil {
- return "", errors.Wrapf(err, "could not get infra")
- }
- if ctr != nil {
- ctr.Start(context.Background(), true)
- cgroupPath, err := ctr.CgroupPath()
- fmt.Println(cgroupPath)
- if err != nil {
- return "", errors.Wrapf(err, "could not get container cgroup")
- }
- p.state.CgroupPath = cgroupPath
- p.save()
- return cgroupPath, nil
- }
- }
return p.state.CgroupPath, nil
}