mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Merge pull request #14045 from cdoern/cgroupPath
remove unused codepath for creating/running ctr in a pod
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
package libpod
|
package libpod
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
@ -305,35 +304,9 @@ func (p *Pod) CgroupPath() (string, error) {
|
|||||||
if err := p.updatePod(); err != nil {
|
if err := p.updatePod(); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
if p.state.CgroupPath != "" {
|
|
||||||
return p.state.CgroupPath, nil
|
|
||||||
}
|
|
||||||
if p.state.InfraContainerID == "" {
|
if p.state.InfraContainerID == "" {
|
||||||
return "", errors.Wrap(define.ErrNoSuchCtr, "pod has no infra container")
|
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
|
return p.state.CgroupPath, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user