summaryrefslogtreecommitdiff
path: root/libpod/runtime_pod_infra_linux.go
diff options
context:
space:
mode:
authorcdoern <cbdoer23@g.holycross.edu>2021-06-17 17:36:35 -0400
committercdoern <cbdoer23@g.holycross.edu>2021-06-23 13:47:57 -0400
commitbbd085ad1e3cf9c5b543c907ad7014ccf8a5cb34 (patch)
tree14dd2d240f32586a624f6a786d8127b8bfb95017 /libpod/runtime_pod_infra_linux.go
parent510509bafcdd055b4a6819ed300db7292c6fb6b8 (diff)
downloadpodman-bbd085ad1e3cf9c5b543c907ad7014ccf8a5cb34.tar.gz
podman-bbd085ad1e3cf9c5b543c907ad7014ccf8a5cb34.tar.bz2
podman-bbd085ad1e3cf9c5b543c907ad7014ccf8a5cb34.zip
Podman Pod Create --cpus and --cpuset-cpus flags
Added logic and handling for two new Podman pod create Flags. --cpus specifies the total number of cores on which the pod can execute, this is a combination of the period and quota for the CPU. --cpuset-cpus is a string value which determines of these available cores, how many we will truly execute on. Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
Diffstat (limited to 'libpod/runtime_pod_infra_linux.go')
-rw-r--r--libpod/runtime_pod_infra_linux.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go
index c20153c8d..6b002f65a 100644
--- a/libpod/runtime_pod_infra_linux.go
+++ b/libpod/runtime_pod_infra_linux.go
@@ -146,7 +146,6 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, rawIm
options = append(options, WithExitCommand(p.config.InfraContainer.ExitCommand))
}
}
-
g.SetRootReadonly(true)
g.SetProcessArgs(infraCtrCommand)
@@ -173,7 +172,6 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, rawIm
// Ignore mqueue sysctls if not sharing IPC
if !p.config.UsePodIPC && strings.HasPrefix(sysctlKey, "fs.mqueue.") {
logrus.Infof("Sysctl %s=%s ignored in containers.conf, since IPC Namespace for pod is unused", sysctlKey, sysctlVal)
-
continue
}
@@ -188,7 +186,6 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, rawIm
logrus.Infof("Sysctl %s=%s ignored in containers.conf, since UTS Namespace for pod is unused", sysctlKey, sysctlVal)
continue
}
-
g.AddLinuxSysctl(sysctlKey, sysctlVal)
}
@@ -200,7 +197,11 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, rawIm
if len(p.config.InfraContainer.ConmonPidFile) > 0 {
options = append(options, WithConmonPidFile(p.config.InfraContainer.ConmonPidFile))
}
+ newRes := new(spec.LinuxResources)
+ newRes.CPU = new(spec.LinuxCPU)
+ newRes.CPU = p.ResourceLim().CPU
+ g.Config.Linux.Resources.CPU = newRes.CPU
return r.newContainer(ctx, g.Config, options...)
}
@@ -211,7 +212,6 @@ func (r *Runtime) createInfraContainer(ctx context.Context, p *Pod) (*Container,
if !r.valid {
return nil, define.ErrRuntimeStopped
}
-
imageName := p.config.InfraContainer.InfraImage
if imageName == "" {
imageName = r.config.Engine.InfraImage