mirror of https://github.com/k3s-io/k3s
Merge pull request #29509 from Hui-Zhi/container-devices
Automatic merge from submit-queue Fix devices information struct in container So far nowhere use the ```Devices``` which in ```RunContainerOptions```. But when I want to use it, found that it could be better if change it, because Devices in container is like: ```json "Devices": [ { "PathOnHost": "/dev/nvidiactl", "PathInContainer": "/dev/nvidiactl", "CgroupPermissions": "mrw" }, { "PathOnHost": "/dev/nvidia-uvm", "PathInContainer": "/dev/nvidia-uvm", "CgroupPermissions": "mrw" }, { "PathOnHost": "/dev/nvidia0", "PathInContainer": "/dev/nvidia0", "CgroupPermissions": "mrw" } ], ```pull/6/head
commit
d0214ee303
|
@ -381,6 +381,15 @@ type PortMapping struct {
|
||||||
HostIP string
|
HostIP string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DeviceInfo struct {
|
||||||
|
// Path on host for mapping
|
||||||
|
PathOnHost string
|
||||||
|
// Path in Container to map
|
||||||
|
PathInContainer string
|
||||||
|
// Cgroup permissions
|
||||||
|
Permissions string
|
||||||
|
}
|
||||||
|
|
||||||
// RunContainerOptions specify the options which are necessary for running containers
|
// RunContainerOptions specify the options which are necessary for running containers
|
||||||
type RunContainerOptions struct {
|
type RunContainerOptions struct {
|
||||||
// The environment variables list.
|
// The environment variables list.
|
||||||
|
@ -388,7 +397,7 @@ type RunContainerOptions struct {
|
||||||
// The mounts for the containers.
|
// The mounts for the containers.
|
||||||
Mounts []Mount
|
Mounts []Mount
|
||||||
// The host devices mapped into the containers.
|
// The host devices mapped into the containers.
|
||||||
Devices []string
|
Devices []DeviceInfo
|
||||||
// The port mappings for the containers.
|
// The port mappings for the containers.
|
||||||
PortMappings []PortMapping
|
PortMappings []PortMapping
|
||||||
// If the container has specified the TerminationMessagePath, then
|
// If the container has specified the TerminationMessagePath, then
|
||||||
|
|
Loading…
Reference in New Issue