utils

package
v0.0.0-...-939231d Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeAlreadyReservedError = errors.New("node is already reserved")

Functions

func AppendLabelToNode

func AppendLabelToNode(clientSet *kubernetes.Clientset, node *v1.Node, labelKey, labelValue string) error

func DeletePod

func DeletePod(clientSet *kubernetes.Clientset, pod *v1.Pod) error

func GetNode

func GetNode(clientSet *kubernetes.Clientset, nodeName string) (*v1.Node, error)

func GetPodsOfNode

func GetPodsOfNode(clientSet *kubernetes.Clientset, nodeName, namespace string) (*v1.PodList, error)

func IsGpusVisible

func IsGpusVisible(clientSet *kubernetes.Clientset, request *v1alpha1.ComposabilityRequest) (bool, error)

func NodeHasGpuPods

func NodeHasGpuPods(clientSet *kubernetes.Clientset, nodeName string) (bool, error)

func NodeHasPendingPods

func NodeHasPendingPods(clientSet *kubernetes.Clientset, nodeName string) (bool, error)

func NvidiaDaemonsetsPresent

func NvidiaDaemonsetsPresent(clientSet *kubernetes.Clientset, request *v1alpha1.ComposabilityRequest, installStatus string) (bool, error)

func RemoveLabelFromNode

func RemoveLabelFromNode(clientSet *kubernetes.Clientset, node *v1.Node, labelKey, labelValue string) error

func ReserveNode

func ReserveNode(clientSet *kubernetes.Clientset, node *v1.Node, instance *v1alpha1.ComposabilityRequest) error

func ReserveNodesOfTheCRD

func ReserveNodesOfTheCRD(clientSet *kubernetes.Clientset, request *v1alpha1.ComposabilityRequest) (bool, error)

func RestoreLabels

func RestoreLabels(clientSet *kubernetes.Clientset, request *v1alpha1.ComposabilityRequest) (bool, error)

func SetNodeSchedulable

func SetNodeSchedulable(clientSet *kubernetes.Clientset, request *v1alpha1.ComposabilityRequest) (bool, error)

func SetNodeUnschedulable

func SetNodeUnschedulable(clientSet *kubernetes.Clientset, request *v1alpha1.ComposabilityRequest) (bool, error)

func StopDaemonsets

func StopDaemonsets(clientSet *kubernetes.Clientset, request *v1alpha1.ComposabilityRequest) (bool, error)

func UnReserveNode

func UnReserveNode(clientSet *kubernetes.Clientset, node *v1.Node, instance *v1alpha1.ComposabilityRequest) error

func UnReserveNodesOfTheCRD

func UnReserveNodesOfTheCRD(clientSet *kubernetes.Clientset, request *v1alpha1.ComposabilityRequest, checkOnUpdatedResources bool) (bool, error)

func UninstallDrivers

func UninstallDrivers(clientSet *kubernetes.Clientset, request *v1alpha1.ComposabilityRequest) (bool, error)

func UpdateNode

func UpdateNode(clientSet *kubernetes.Clientset, node *v1.Node) error

func UpdateUnschedulableValue

func UpdateUnschedulableValue(clientSet *kubernetes.Clientset, node *v1.Node, desiredState bool) error

Types

type OperationResult

type OperationResult struct {
	RequeueDelay   time.Duration
	RequeueRequest bool
	CancelRequest  bool
}

func ContinueOperationResult

func ContinueOperationResult() OperationResult

func ContinueProcessing

func ContinueProcessing() (result OperationResult, err error)

func Requeue

func Requeue() (result OperationResult, err error)

func RequeueAfter

func RequeueAfter(delay time.Duration, errIn error) (result OperationResult, err error)

func RequeueWithError

func RequeueWithError(errIn error) (result OperationResult, err error)

func StopOperationResult

func StopOperationResult() OperationResult

func StopProcessing

func StopProcessing() (result OperationResult, err error)

Jump to

Keyboard shortcuts

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