utils

package
v0.0.0-...-41a4b2b Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0, Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(obj metav1.Object, finalizers ...string)

AddFinalizer will add the given finalizer to the object. It uses a StringSet to avoid duplicates.

func GetConfigMapData

func GetConfigMapData(ctx context.Context, client ctrlruntimeclient.Client, namespace string, ref *corev1.ConfigMapKeySelector) (string, error)

func HashObject

func HashObject(any interface{}) (string, error)

func MarkCondition

func MarkCondition(set func(condition metav1.Condition), conditionType v1alpha1.ConditionType, conditionStatus metav1.ConditionStatus, conditionReason v1alpha1.ConditionReason, message string, messageArgs ...interface{})

func MarkFalse

func MarkFalse(set func(metav1.Condition), conditionType v1alpha1.ConditionType, conditionReason v1alpha1.ConditionReason, message string, messageArgs ...interface{})

func MarkTrue

func MarkTrue(set func(metav1.Condition), conditionType v1alpha1.ConditionType, conditionReason v1alpha1.ConditionReason, message string, messageArgs ...interface{})

func RemoveFinalizer

func RemoveFinalizer(obj metav1.Object, toRemove ...string)

RemoveFinalizer removes the given finalizers from the object.

func SyncCondition

func SyncCondition(set func(condition metav1.Condition), conditionType, status, reason, message *string)

func TryAddControllerRef

func TryAddControllerRef(ctx context.Context, client ctrlruntimeclient.Client, owner ctrlruntimeclient.Object, controlled ctrlruntimeclient.Object, scheme *runtime.Scheme) error

func TryAddFinalizer

func TryAddFinalizer(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, finalizers ...string) error

func TryRemoveFinalizer

func TryRemoveFinalizer(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, finalizers ...string) error

func TryUpdateStatus

func TryUpdateStatus[PatchObject ctrlruntimeclient.Object](ctx context.Context, client ctrlruntimeclient.Client, object PatchObject, patch Patcher[PatchObject]) error

TryUpdateStatus TODO ...

Types

type ConsoleHelper

type ConsoleHelper struct {
	// contains filtered or unexported fields
}

func NewConsoleHelper

func NewConsoleHelper(ctx context.Context, client client.ConsoleClient, k8sClient k8sclient.Client) *ConsoleHelper

func (*ConsoleHelper) IDFromRef

func (in *ConsoleHelper) IDFromRef(ref *v1.ObjectReference, resource v1alpha1.PluralResource) (*string, error)

type Patcher

type Patcher[PatchObject ctrlruntimeclient.Object] func(object PatchObject, original PatchObject) (compare any, compareTo any)

Patcher TODO ...

Jump to

Keyboard shortcuts

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