device

package
v1.25.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DeviceAnnotationDelim = ","

DeviceAnnotationDelim is the character used to separate devices in the annotation `io.kubernetes.cri-o.Devices`

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is the internal device configuration it holds onto the contents of the additional_devices field, allowing admins to configure devices that are given to all containers.

func New

func New() *Config

New creates a new device Config

func (*Config) Devices

func (d *Config) Devices() []Device

Devices returns the devices saved in the Config

func (*Config) LoadDevices

func (d *Config) LoadDevices(devsFromConfig []string) error

LoadDevices takes a slice of strings of additional_devices specified in the config. It saves the resulting Device structs, so they are processed once and used later.

type Device

type Device struct {
	Device   rspec.LinuxDevice
	Resource rspec.LinuxDeviceCgroup
}

Device holds the runtime spec fields needed for a device

func DevicesFromAnnotation

func DevicesFromAnnotation(annotation string, allowedDevices []string) ([]Device, error)

DevicesFromAnnotation takes an annotation string of the form io.kubernetes.cri-o.Device=$PATH:$PATH:$MODE,$PATH... and returns a Device object that can be passed to a create config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL