utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 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 IndexFieldResourceSliceNode = "slurmBridge.resourceSliceNode"

IndexFieldResourceSliceNode is the field index name under which ResourceSlices are indexed by their single node name. Unsupported node selection is indexed under IndexValueResourceSliceGlobal so inventory validation can reject it.

View Source
const IndexFieldResourceSlicePool = "slurmBridge.resourceSlicePool"

IndexFieldResourceSlicePool indexes ResourceSlices by driver and pool, across all nodes and generations, so node filtering cannot hide inconsistent pools.

View Source
const IndexFieldSlurmNodeName = "slurmBridge.slurmNodeName"

IndexFieldSlurmNodeName is the field index name under which Nodes are indexed by their Slurm node name (see GetSlurmNodeName), so the corresponding Kubernetes Node can be resolved without listing every Node in the cluster.

View Source
const IndexValueResourceSliceGlobal = "*"

IndexValueResourceSliceGlobal is the index value used for ResourceSlices that are not scoped to a single node name.

Variables

This section is empty.

Functions

func GetNodeNameForSlurmName added in v1.3.0

func GetNodeNameForSlurmName(ctx context.Context, reader client.Reader, slurmName string) (string, bool, error)

GetNodeNameForSlurmName resolves the Kubernetes node name for a given Slurm node name, using IndexFieldSlurmNodeName instead of listing every Node. If multiple Nodes share the same Slurm node name, the last one returned by the index is preferred, mirroring the last-write-wins behavior of the old MakeNodeNameMap-based lookup.

If reader doesn't support the index (e.g. a client that talks directly to the API server instead of a manager's indexed cache), this falls back to listing every Node, so callers stay correct regardless of which client they were constructed with.

func GetResourceSlicesForNode added in v1.3.0

func GetResourceSlicesForNode(ctx context.Context, reader client.Reader, nodeName string) ([]resourcev1.ResourceSlice, error)

GetResourceSlicesForNode returns every slice in pools with a slice assigned to nodeName, plus pools using unsupported node selection. Include all generations and nodes so callers can validate the latest generation before filtering by node.

If reader doesn't support the index, this falls back to listing every ResourceSlice, so callers stay correct regardless of which client they were constructed with.

func GetResourceSlicesForPool added in v1.3.0

func GetResourceSlicesForPool(ctx context.Context, reader client.Reader, poolID dra.ResourcePoolID) ([]resourcev1.ResourceSlice, error)

GetResourceSlicesForPool returns all generations and node assignments for one driver/pool. Readers without the pool index fall back to a full list scan.

func GetSlurmNodeName

func GetSlurmNodeName(node *corev1.Node) string

func IndexNodeBySlurmName added in v1.3.0

func IndexNodeBySlurmName(obj client.Object) []string

IndexNodeBySlurmName is the IndexerFunc for IndexFieldSlurmNodeName.

func IndexResourceSliceByNode added in v1.3.0

func IndexResourceSliceByNode(obj client.Object) []string

IndexResourceSliceByNode is the IndexerFunc for IndexFieldResourceSliceNode.

func IndexResourceSliceByPool added in v1.3.0

func IndexResourceSliceByPool(obj client.Object) []string

IndexResourceSliceByPool is the IndexerFunc for IndexFieldResourceSlicePool.

func MakeNodeNameMap

func MakeNodeNameMap(ctx context.Context, nodeList *corev1.NodeList) map[string]string

func SetupFieldIndexers added in v1.3.0

func SetupFieldIndexers(mgr ctrl.Manager) error

SetupFieldIndexers registers the field indexes used by the node controller and the slurmnode runnable to resolve a Kubernetes Node from a Slurm node name, and to resolve the ResourceSlices relevant to a given Node.

Types

This section is empty.

Jump to

Keyboard shortcuts

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