types

package
v1.21.0-pre.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KernelIfNameLabel contains the interface name
	// assigned by the kernel.
	KernelIfNameLabel = "kernelIfName"
	// IfNameLabel contains the name of the device
	// as assigned by the device managers.
	// must be unique across all devices on the node.
	IfNameLabel = "ifName"
	// HWAddrLabel contains the MAC address of the device.
	HWAddrLabel = "macAddress"
	// DeviceManagerLabel identifies which Device Manager
	// published the device.
	DeviceManagerLabel = "deviceManager"
	// PoolNameLabel is the pool name.
	PoolNameLabel = "pool"
)

The labels below are used by the device managers to tag their devices for advertising ResourceSlices. These attributes may be used to filter and match devices on a resource claim.

View Source
const (
	// MaxInterfaceNameLength is the maximum length for a Linux interface name (IFNAMSIZ - 1)
	MaxInterfaceNameLength = 15
)

Interface name validation constants

Variables

This section is empty.

Functions

func ValidateInterfaceName

func ValidateInterfaceName(name string) error

ValidateInterfaceName validates an interface name according to Linux rules

Types

type DeviceConfig

type DeviceConfig struct {
	PodIfName string `json:"podIfName,omitempty"` // Custom interface name for the pod namespace
}

func (*DeviceConfig) Empty

func (d *DeviceConfig) Empty() bool

type DeviceManager

type DeviceManager interface {
	Type() DeviceManagerType
	ListDevices() ([]Device, error)
	RestoreDevice([]byte) (Device, error)
}

type DeviceManagerConfig

type DeviceManagerConfig interface {
	IsEnabled() bool
}

type DeviceManagerType

type DeviceManagerType int
const (
	// DeviceManagerTypeMock is a sentinel used by unit tests.
	// It is intentionally kept in the types package so that test files in
	// the networkdriver package can reference it without importing a real
	// device-manager package.
	DeviceManagerTypeMock DeviceManagerType = iota
	DeviceManagerTypeDummy
	DeviceManagerTypeUnknown
)

func (DeviceManagerType) MarshalText

func (d DeviceManagerType) MarshalText() (text []byte, err error)

func (DeviceManagerType) String

func (d DeviceManagerType) String() string

func (*DeviceManagerType) UnmarshalText

func (d *DeviceManagerType) UnmarshalText(text []byte) error

type SerializedDevice

type SerializedDevice struct {
	Manager DeviceManagerType
	Dev     json.RawMessage
	Config  DeviceConfig
}

Jump to

Keyboard shortcuts

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