From 8fac34b8ff05314fe6996567af9336cf034b2d03 Mon Sep 17 00:00:00 2001 From: cdoern Date: Sun, 5 Sep 2021 23:22:17 -0400 Subject: 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 --- pkg/domain/entities/pods.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/domain') 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, " ") -- cgit v1.2.3-54-g00ecf