k8sutils

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(ctx context.Context, k8sClient client.Client, nm *maintenancev1.NodeMaintenance, finalizer string) error

AddFinalizer conditionally adds finalizer from NodeMaintenance

func GetReadyConditionReason

func GetReadyConditionReason(nm *maintenancev1.NodeMaintenance) string

GetReadyConditionReason returns NodeMaintenance Ready condition.Reason or empty string if unset

func HasOwnerRef

func HasOwnerRef(owner metav1.Object, object metav1.Object) bool

HasOwnerRef returns true if object owned by owner

func IsNodeReady

func IsNodeReady(n *corev1.Node) bool

IsNodeReady returns true if Node is ready

func IsNodeUnschedulable

func IsNodeUnschedulable(n *corev1.Node) bool

IsNodeUnschedulable returns true if node is Unschedulabel

func IsUnderMaintenance

func IsUnderMaintenance(nm *maintenancev1.NodeMaintenance) bool

IsUnderMaintenance returns true if NodeMaintenance is currently undergoing maintenance

func RemoveFinalizer

func RemoveFinalizer(ctx context.Context, k8sClient client.Client, nm *maintenancev1.NodeMaintenance, finalizer string) error

RemoveFinalizer conditionally removes finalizer from NodeMaintenance

func SetOwnerRef

func SetOwnerRef(ctx context.Context, k8sClient client.Client, owner metav1.Object, object client.Object) error

SetOwnerRef conditionally sets owner referece of object to owner

func SetReadyConditionReason

func SetReadyConditionReason(ctx context.Context, client client.Client, nm *maintenancev1.NodeMaintenance, reason string) error

SetReadyConditionReason sets or updates Ready condition in nm.Status with reason. in addition, it updates status of the object in k8s api if required. returns error if occurred.

func SetReadyConditionReasonMsg

func SetReadyConditionReasonMsg(ctx context.Context, client client.Client, nm *maintenancev1.NodeMaintenance, reason string, msg string) error

SetReadyConditionReasonMsg sets or updates Ready condition in nm.Status with reason and msg. in addition, it updates status of the object in k8s api if required. returns error if occurred.

Types

This section is empty.

Jump to

Keyboard shortcuts

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