diff options
author | cdoern <cdoern@redhat.com> | 2021-09-05 23:22:17 -0400 |
---|---|---|
committer | cdoern <cdoern@redhat.com> | 2021-09-20 23:22:43 -0400 |
commit | 8fac34b8ff05314fe6996567af9336cf034b2d03 (patch) | |
tree | 6d3b482de0ef857f8956c35c35788238f706c303 /pkg/domain/entities | |
parent | b925d707fa768245b3bd50d570b91992c1814dba (diff) | |
download | podman-8fac34b8ff05314fe6996567af9336cf034b2d03.tar.gz podman-8fac34b8ff05314fe6996567af9336cf034b2d03.tar.bz2 podman-8fac34b8ff05314fe6996567af9336cf034b2d03.zip |
Pod Device Support
added support for pod devices. The device gets added to the infra container and
recreated in all containers that join the pod.
This required a new container config item to keep track of the original device passed in by the user before
the path was parsed into the container device.
Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'pkg/domain/entities')
-rw-r--r-- | pkg/domain/entities/pods.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go index 88bd3c6ce..f0c88d77e 100644 --- a/pkg/domain/entities/pods.go +++ b/pkg/domain/entities/pods.go @@ -118,6 +118,7 @@ type PodSpec struct { type PodCreateOptions struct { CGroupParent string `json:"cgroup_parent,omitempty"` CreateCommand []string `json:"create_command,omitempty"` + Devices []string `json:"devices,omitempty"` Hostname string `json:"hostname,omitempty"` Infra bool `json:"infra,omitempty"` InfraImage string `json:"infra_image,omitempty"` @@ -164,7 +165,7 @@ type ContainerCreateOptions struct { CPUS float64 `json:"cpus,omitempty"` CPUSetCPUs string `json:"cpuset_cpus,omitempty"` CPUSetMems string - Devices []string + Devices []string `json:"devices,omitempty"` DeviceCGroupRule []string DeviceReadBPs []string DeviceReadIOPs []string @@ -295,6 +296,7 @@ func ToPodSpecGen(s specgen.PodSpecGenerator, p *PodCreateOptions) (*specgen.Pod s.Pid = out s.Hostname = p.Hostname s.Labels = p.Labels + s.Devices = p.Devices s.NoInfra = !p.Infra if p.InfraCommand != nil && len(*p.InfraCommand) > 0 { s.InfraCommand = strings.Split(*p.InfraCommand, " ") |