specs

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: Apache-2.0 Imports: 4 Imported by: 16

Documentation

Index

Constants

View Source
const (
	// CurrentVersion is the current version of the Spec.
	CurrentVersion = "1.0.0"
)

Variables

This section is empty.

Functions

func MinimumRequiredVersion added in v1.0.0

func MinimumRequiredVersion(spec *Spec) (string, error)

MinimumRequiredVersion determines the minimum spec version for the input spec.

func ValidateVersion added in v1.0.0

func ValidateVersion(spec *Spec) error

ValidateVersion checks whether the specified spec version is valid. In addition to checking whether the spec version is in the set of known versions, the spec is inspected to determine whether the features used are available in specified version.

Types

type ContainerEdits

type ContainerEdits struct {
	Env            []string      `json:"env,omitempty"            yaml:"env,omitempty"`
	DeviceNodes    []*DeviceNode `json:"deviceNodes,omitempty"    yaml:"deviceNodes,omitempty"`
	Hooks          []*Hook       `json:"hooks,omitempty"          yaml:"hooks,omitempty"`
	Mounts         []*Mount      `json:"mounts,omitempty"         yaml:"mounts,omitempty"`
	IntelRdt       *IntelRdt     `json:"intelRdt,omitempty"       yaml:"intelRdt,omitempty"`       // Added in v0.7.0
	AdditionalGIDs []uint32      `json:"additionalGids,omitempty" yaml:"additionalGids,omitempty"` // Added in v0.7.0
}

ContainerEdits are edits a container runtime must make to the OCI spec to expose the device.

type Device

type Device struct {
	Name string `json:"name" yaml:"name"`
	// Annotations add meta information per device. Note these are CDI-specific and do not affect container metadata.
	// Added in v0.6.0.
	Annotations    map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	ContainerEdits ContainerEdits    `json:"containerEdits"        yaml:"containerEdits"`
}

Device is a "Device" a container runtime can add to a container

type DeviceNode

type DeviceNode struct {
	Path        string       `json:"path"                  yaml:"path"`
	HostPath    string       `json:"hostPath,omitempty"    yaml:"hostPath,omitempty"` // Added in v0.5.0
	Type        string       `json:"type,omitempty"        yaml:"type,omitempty"`
	Major       int64        `json:"major,omitempty"       yaml:"major,omitempty"`
	Minor       int64        `json:"minor,omitempty"       yaml:"minor,omitempty"`
	FileMode    *os.FileMode `json:"fileMode,omitempty"    yaml:"fileMode,omitempty"`
	Permissions string       `json:"permissions,omitempty" yaml:"permissions,omitempty"`
	UID         *uint32      `json:"uid,omitempty"         yaml:"uid,omitempty"`
	GID         *uint32      `json:"gid,omitempty"         yaml:"gid,omitempty"`
}

DeviceNode represents a device node that needs to be added to the OCI spec.

type Hook

type Hook struct {
	HookName string   `json:"hookName"          yaml:"hookName"`
	Path     string   `json:"path"              yaml:"path"`
	Args     []string `json:"args,omitempty"    yaml:"args,omitempty"`
	Env      []string `json:"env,omitempty"     yaml:"env,omitempty"`
	Timeout  *int     `json:"timeout,omitempty" yaml:"timeout,omitempty"`
}

Hook represents a hook that needs to be added to the OCI spec.

type IntelRdt added in v0.7.0

type IntelRdt struct {
	ClosID        string `json:"closID,omitempty"        yaml:"closID,omitempty"`
	L3CacheSchema string `json:"l3CacheSchema,omitempty" yaml:"l3CacheSchema,omitempty"`
	MemBwSchema   string `json:"memBwSchema,omitempty"   yaml:"memBwSchema,omitempty"`
	EnableCMT     bool   `json:"enableCMT,omitempty"     yaml:"enableCMT,omitempty"`
	EnableMBM     bool   `json:"enableMBM,omitempty"     yaml:"enableMBM,omitempty"`
}

IntelRdt describes the Linux IntelRdt parameters to set in the OCI spec.

type Mount

type Mount struct {
	HostPath      string   `json:"hostPath"          yaml:"hostPath"`
	ContainerPath string   `json:"containerPath"     yaml:"containerPath"`
	Options       []string `json:"options,omitempty" yaml:"options,omitempty"`
	Type          string   `json:"type,omitempty"    yaml:"type,omitempty"` // Added in v0.4.0
}

Mount represents a mount that needs to be added to the OCI spec.

type Spec

type Spec struct {
	Version string `json:"cdiVersion" yaml:"cdiVersion"`
	Kind    string `json:"kind"       yaml:"kind"`
	// Annotations add meta information per CDI spec. Note these are CDI-specific and do not affect container metadata.
	// Added in v0.6.0.
	Annotations    map[string]string `json:"annotations,omitempty"    yaml:"annotations,omitempty"`
	Devices        []Device          `json:"devices"                  yaml:"devices"`
	ContainerEdits ContainerEdits    `json:"containerEdits,omitempty" yaml:"containerEdits,omitempty"`
}

Spec is the base configuration for CDI

Jump to

Keyboard shortcuts

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