Documentation
¶
Index ¶
- Constants
- func GetNodeNameForSlurmName(ctx context.Context, reader client.Reader, slurmName string) (string, bool, error)
- func GetResourceSlicesForNode(ctx context.Context, reader client.Reader, nodeName string) ([]resourcev1.ResourceSlice, error)
- func GetResourceSlicesForPool(ctx context.Context, reader client.Reader, poolID dra.ResourcePoolID) ([]resourcev1.ResourceSlice, error)
- func GetSlurmNodeName(node *corev1.Node) string
- func IndexNodeBySlurmName(obj client.Object) []string
- func IndexResourceSliceByNode(obj client.Object) []string
- func IndexResourceSliceByPool(obj client.Object) []string
- func MakeNodeNameMap(ctx context.Context, nodeList *corev1.NodeList) map[string]string
- func SetupFieldIndexers(mgr ctrl.Manager) error
Constants ¶
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.
const IndexFieldResourceSlicePool = "slurmBridge.resourceSlicePool"
IndexFieldResourceSlicePool indexes ResourceSlices by driver and pool, across all nodes and generations, so node filtering cannot hide inconsistent pools.
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.
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 IndexNodeBySlurmName ¶ added in v1.3.0
IndexNodeBySlurmName is the IndexerFunc for IndexFieldSlurmNodeName.
func IndexResourceSliceByNode ¶ added in v1.3.0
IndexResourceSliceByNode is the IndexerFunc for IndexFieldResourceSliceNode.
func IndexResourceSliceByPool ¶ added in v1.3.0
IndexResourceSliceByPool is the IndexerFunc for IndexFieldResourceSlicePool.
func MakeNodeNameMap ¶
func SetupFieldIndexers ¶ added in v1.3.0
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.