dpuselector

package
v0.1.0-latest-stable Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 6 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DPUSelectFunc

type DPUSelectFunc func(ctx context.Context, dpuNode *provisioningv1.DPUNode, dpus []provisioningv1.DPU) (*provisioningv1.DPU, error)

DPUSelectFunc is a function that selects a DPU from a list of candidates. The function is called with a list of candidates and should return the selected DPU. If the function cannot select a DPU, it should return nil and an error.

type DPUSelector

type DPUSelector interface {
	// GetDPUForNode finds single DPU for a DPUNode. If multiple DPUs are found, an error is returned.
	GetDPUForNode(ctx context.Context, c client.Client, dpuNode *provisioningv1.DPUNode) (*provisioningv1.DPU, error)
	// ListDPUsForNode returns a list of DPUs for a Node.
	ListDPUsForNode(ctx context.Context, c client.Client, dpuNode *provisioningv1.DPUNode) ([]provisioningv1.DPU, error)
}

DPUSelector selects DPUs for nodes.

func New

func New(opts ...Option) DPUSelector

New creates a DPUSelector with the given options.

type Option

type Option interface {
	// Apply modifies the Options struct.
	Apply(options *Options)
}

Option configures DPU selection behavior.

type Options

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

Options holds configuration for DPU selection.

func (Options) MarshalLog

func (o Options) MarshalLog() any

MarshalLog emits a struct containing key/value pairs for logging.

type WithDPUSelectFunc

type WithDPUSelectFunc struct {
	SelectFunc DPUSelectFunc
}

WithDPUSelectFunc sets the dpu select function. The function is called with a list of candidates and should return the selected DPU. If the function cannot select a DPU, it should return nil and an error.

func (WithDPUSelectFunc) Apply

func (o WithDPUSelectFunc) Apply(options *Options)

Apply sets the dpu select function.

type WithInNamespace

type WithInNamespace struct {
	Namespace string
}

WithInNamespace restricts DPU selection to specific namespace.

func (WithInNamespace) Apply

func (o WithInNamespace) Apply(options *Options)

Apply sets the namespace restriction.

type WithIndexerField

type WithIndexerField struct {
	FieldName string
}

WithIndexerField uses indexed field for efficient DPU lookups.

func (WithIndexerField) Apply

func (o WithIndexerField) Apply(options *Options)

Apply sets the indexer field name.

type WithLabelSelector

type WithLabelSelector struct {
	Selector labels.Selector
}

WithLabelSelector filters DPUs by label selector.

func (WithLabelSelector) Apply

func (o WithLabelSelector) Apply(options *Options)

Apply sets the label selector.

Jump to

Keyboard shortcuts

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