summaryrefslogtreecommitdiff
path: root/libpod/pod.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2021-09-15 13:40:16 -0400
committerMatthew Heon <mheon@redhat.com>2021-09-16 09:42:14 -0400
commit3c24d1fda2c0b0d55c963deaf13900101a40bfb3 (patch)
tree7bf335562865fb15791cb18b4c15da3b9b9015a8 /libpod/pod.go
parentfcb22e82b518bd8de31bc152b78d2cbc6ab09964 (diff)
downloadpodman-3c24d1fda2c0b0d55c963deaf13900101a40bfb3.tar.gz
podman-3c24d1fda2c0b0d55c963deaf13900101a40bfb3.tar.bz2
podman-3c24d1fda2c0b0d55c963deaf13900101a40bfb3.zip
Remove pod create options `--cpus` and `--cpuset-cpus`
These are not presently functional - we need a rewrite of how the pod cgroup is handled first. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/pod.go')
-rw-r--r--libpod/pod.go89
1 files changed, 0 insertions, 89 deletions
diff --git a/libpod/pod.go b/libpod/pod.go
index e4516b354..0d5d629cd 100644
--- a/libpod/pod.go
+++ b/libpod/pod.go
@@ -1,7 +1,6 @@
package libpod
import (
- "context"
"fmt"
"sort"
"time"
@@ -99,65 +98,6 @@ func (p *Pod) Namespace() string {
return p.config.Namespace
}
-// ResourceLim returns the cpuset resource limits for the pod
-func (p *Pod) ResourceLim() *specs.LinuxResources {
- resCopy := &specs.LinuxResources{}
- empty := &specs.LinuxResources{
- CPU: &specs.LinuxCPU{},
- }
- infra, err := p.runtime.GetContainer(p.state.InfraContainerID)
- if err != nil {
- return empty
- }
- conf := infra.config.Spec
- if err != nil {
- return empty
- }
- if conf.Linux == nil || conf.Linux.Resources == nil {
- return empty
- }
- if err = JSONDeepCopy(conf.Linux.Resources, resCopy); err != nil {
- return nil
- }
- if resCopy.CPU != nil {
- return resCopy
- }
-
- return empty
-}
-
-// CPUPeriod returns the pod CPU period
-func (p *Pod) CPUPeriod() uint64 {
- if p.state.InfraContainerID == "" {
- return 0
- }
- infra, err := p.runtime.GetContainer(p.state.InfraContainerID)
- if err != nil {
- return 0
- }
- conf := infra.config.Spec
- if conf != nil && conf.Linux != nil && conf.Linux.Resources != nil && conf.Linux.Resources.CPU != nil && conf.Linux.Resources.CPU.Period != nil {
- return *conf.Linux.Resources.CPU.Period
- }
- return 0
-}
-
-// CPUQuota returns the pod CPU quota
-func (p *Pod) CPUQuota() int64 {
- if p.state.InfraContainerID == "" {
- return 0
- }
- infra, err := p.runtime.GetContainer(p.state.InfraContainerID)
- if err != nil {
- return 0
- }
- conf := infra.config.Spec
- if conf != nil && conf.Linux != nil && conf.Linux.Resources != nil && conf.Linux.Resources.CPU != nil && conf.Linux.Resources.CPU.Quota != nil {
- return *conf.Linux.Resources.CPU.Quota
- }
- return 0
-}
-
// PidMode returns the PID mode given by the user ex: pod, private...
func (p *Pod) PidMode() string {
infra, err := p.runtime.GetContainer(p.state.InfraContainerID)
@@ -282,35 +222,6 @@ 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
}