utils

package
v0.1.0-alpha.1....-9b31e75 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAndPatchFinalizer

func AddAndPatchFinalizer(ctx context.Context, writer client.Writer, obj client.Object, finalizer string) error

AddAndPatchFinalizer uses merge-patch strategy to patch the given object with the given finalizer.

func GetPodClique

func GetPodClique(ctx context.Context, cl client.Client, logger logr.Logger, objectKey client.ObjectKey, pclq *v1alpha1.PodClique, ignoreNotFound bool) grovectrl.ReconcileStepResult

GetPodClique gets the latest PodClique object. It will usually hit the informer cache. If the object is not found, it will log a message and return DoNotRequeue.

func GetPodCliqueScalingGroup

func GetPodCliqueScalingGroup(ctx context.Context, cl client.Client, logger logr.Logger, objectKey client.ObjectKey, pcsg *v1alpha1.PodCliqueScalingGroup) grovectrl.ReconcileStepResult

GetPodCliqueScalingGroup gets the latest PodCliqueScalingGroup object. It will usually hit the informer cache. If the object is not found, it will log a message and return DoNotRequeue.

func GetPodCliqueSet

func GetPodCliqueSet(ctx context.Context, cl client.Client, logger logr.Logger, objectKey client.ObjectKey, pcs *v1alpha1.PodCliqueSet) grovectrl.ReconcileStepResult

GetPodCliqueSet gets the latest PodCliqueSet object. It will usually hit the informer cache. If the object is not found, it will log a message and return DoNotRequeue.

func HasExpectedOwner

func HasExpectedOwner(expectedOwnerKind string, ownerRefs []metav1.OwnerReference) bool

HasExpectedOwner checks if the owner references of a resource match the expected owner kind.

func IsManagedByGrove

func IsManagedByGrove(labels map[string]string) bool

IsManagedByGrove checks if the pod is managed by Grove by inspecting its labels. All grove managed resources will have a standard set of default labels.

func IsManagedPodClique

func IsManagedPodClique(obj client.Object, expectedOwnerKinds ...string) bool

IsManagedPodClique checks if the PodClique is managed by Grove.

func RemoveAndPatchFinalizer

func RemoveAndPatchFinalizer(ctx context.Context, writer client.Writer, obj client.Object, finalizer string) error

RemoveAndPatchFinalizer uses merge-patch strategy to patch the given object thereby resulting in removal of the given finalizer.

func ShouldContinueReconcileAndRequeue

func ShouldContinueReconcileAndRequeue(err error) bool

ShouldContinueReconcileAndRequeue checks if an error is a Grove error, and if it is, returns true when the error code is groveerr.ErrCodeContinueReconcileAndRequeue.

func ShouldRequeueAfter

func ShouldRequeueAfter(err error) bool

ShouldRequeueAfter checks if an error is a GroveError and if yes then returns true when the error code is groveerr.ErrCodeRequeueAfter along with the GroveError.Message, else it returns false and an empty message.

func VerifyNoResourceAwaitsCleanup

func VerifyNoResourceAwaitsCleanup[T component.GroveCustomResourceType](ctx context.Context, logger logr.Logger, operatorRegistry component.OperatorRegistry[T], objMeta metav1.ObjectMeta) grovectrl.ReconcileStepResult

VerifyNoResourceAwaitsCleanup ensures no resources that are to be cleaned up are still present in the cluster.

Types

This section is empty.

Jump to

Keyboard shortcuts

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