nfd

package
v0.0.0-...-a3ada2b Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// Builder definition. Used to create
	// Builder object with minimum set of required elements.
	Definition *nfdv1.NodeFeatureDiscovery
	// Created Builder object on the cluster.
	Object *nfdv1.NodeFeatureDiscovery
	// contains filtered or unexported fields
}

Builder provides a struct for NodeFeatureDiscovery object from the cluster and a NodeFeatureDiscovery definition.

func NewBuilderFromObjectString

func NewBuilderFromObjectString(apiClient *clients.Settings, almExample string) *Builder

NewBuilderFromObjectString creates a Builder object from CSV alm-examples.

func Pull

func Pull(apiClient *clients.Settings, name, namespace string) (*Builder, error)

Pull loads an existing NodeFeatureDiscovery into Builder struct.

func (*Builder) Create

func (builder *Builder) Create() (*Builder, error)

Create makes a NodeFeatureDiscovery in the cluster and stores the created object in struct.

func (*Builder) Delete

func (builder *Builder) Delete() (*Builder, error)

Delete removes a NodeFeatureDiscovery.

func (*Builder) Exists

func (builder *Builder) Exists() bool

Exists checks whether the given NodeFeatureDiscovery exists.

func (*Builder) Get

func (builder *Builder) Get() (*nfdv1.NodeFeatureDiscovery, error)

Get returns NodeFeatureDiscovery object if found.

func (*Builder) Update

func (builder *Builder) Update(force bool) (*Builder, error)

Update renovates the existing NodeFeatureDiscovery object with the definition in builder.

func (*Builder) UpdatePciDevices

func (builder *Builder) UpdatePciDevices(deviceClassWhitelist []string, deviceLabelFields []string) error

UpdatePciDevices updates the PCI device whitelist configuration in the worker config. Parameters:

  • deviceClassWhitelist: List of PCI device class IDs to whitelist
  • deviceLabelFields: List of fields to be used as labels for the PCI devices

Returns an error if the configuration update fails or if invalid parameters are provided.

type CPUConfig

type CPUConfig struct {
	CPUID struct {
		AttributeBlacklist []string `yaml:"attributeBlacklist,omitempty"`
		AttributeWhitelist []string `yaml:"attributeWhitelist,omitempty"`
	} `yaml:"cpuid,omitempty"`
}

CPUConfig cpu feature config.

type Config

type Config struct {
	Sources Sources `yaml:"sources"`
}

Config worker-config.

func NewConfig

func NewConfig(config string) *Config

func (*Config) GetYamlString

func (cfg *Config) GetYamlString() (string, error)

func (*Config) SetPciWhitelistConfig

func (cfg *Config) SetPciWhitelistConfig(DeviceClassWhitelist, DeviceLabelFields []string)

SetPciWhitelistConfig updates the PCI device whitelist and label fields.

type PCIDevice

type PCIDevice struct {
	DeviceClassWhitelist []string `yaml:"deviceClassWhitelist,omitempty"`
	DeviceLabelFields    []string `yaml:"deviceLabelFields,omitempty"`
}

PCIDevice pci config.

type Sources

type Sources struct {
	CPU    *CPUConfig    `yaml:"cpu,omitempty"`
	PCI    *PCIDevice    `yaml:"pci,omitempty"`
	USB    []interface{} `yaml:"usb,omitempty"`    // Add the necessary struct for USB if needed
	Custom []interface{} `yaml:"custom,omitempty"` // Add the necessary struct for Custom if needed
}

Sources contains all sources.

Jump to

Keyboard shortcuts

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