diff options
author | cdoern <cbdoer23@g.holycross.edu> | 2021-06-17 17:36:35 -0400 |
---|---|---|
committer | cdoern <cbdoer23@g.holycross.edu> | 2021-06-23 13:47:57 -0400 |
commit | bbd085ad1e3cf9c5b543c907ad7014ccf8a5cb34 (patch) | |
tree | 14dd2d240f32586a624f6a786d8127b8bfb95017 /libpod/pod_api.go | |
parent | 510509bafcdd055b4a6819ed300db7292c6fb6b8 (diff) | |
download | podman-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/pod_api.go')
-rw-r--r-- | libpod/pod_api.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/pod_api.go b/libpod/pod_api.go index 14fe8276c..d8f5d15f8 100644 --- a/libpod/pod_api.go +++ b/libpod/pod_api.go @@ -538,6 +538,9 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) { infraConfig.StaticMAC = p.config.InfraContainer.StaticMAC.String() infraConfig.NoManageResolvConf = p.config.InfraContainer.UseImageResolvConf infraConfig.NoManageHosts = p.config.InfraContainer.UseImageHosts + infraConfig.CPUPeriod = p.CPUPeriod() + infraConfig.CPUQuota = p.CPUQuota() + infraConfig.CPUSetCPUs = p.ResourceLim().CPU.Cpus if len(p.config.InfraContainer.DNSServer) > 0 { infraConfig.DNSServer = make([]string, 0, len(p.config.InfraContainer.DNSServer)) @@ -581,6 +584,9 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) { SharedNamespaces: sharesNS, NumContainers: uint(len(containers)), Containers: ctrs, + CPUSetCPUs: p.ResourceLim().CPU.Cpus, + CPUPeriod: p.CPUPeriod(), + CPUQuota: p.CPUQuota(), } return &inspectData, nil |