cdi

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SpecVersion  = "0.8.0"
	Vendor       = "dra.k8s.io"
	Class        = "memory"
	EnvVarPrefix = "DRAMEMORY"
)

Variables

View Source
var (
	SpecDir = "/var/run/cdi"
)

Functions

func MakeDeviceName

func MakeDeviceName(uid types.UID) string

func MakeKind

func MakeKind(vendor, class string) string

Types

type Manager

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

Manager manages a single CDI JSON spec file using a mutex for thread safety.

func NewManager

func NewManager(driverName string, lh logr.Logger) (*Manager, error)

NewManager creates a manager for the driver's CDI spec file.

func (*Manager) AddDevice

func (mgr *Manager) AddDevice(lh logr.Logger, deviceName string, envVars ...string) error

AddDevice adds a device to the CDI spec file.

func (*Manager) EmptySpec

func (mgr *Manager) EmptySpec() *cdiSpec.Spec

func (*Manager) GetSpec

func (mgr *Manager) GetSpec(lh logr.Logger) (*cdiSpec.Spec, error)

func (*Manager) RemoveDevice

func (mgr *Manager) RemoveDevice(lh logr.Logger, deviceName string) error

RemoveDevice removes a device from the CDI spec file.

Jump to

Keyboard shortcuts

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