utils

package
v0.0.0-...-57137be Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSelectedMultiple = errors.New("selection returned multiple items")
)

Functions

func DeleteCondition

func DeleteCondition(conditions []enginev1.Condition, t enginev1.ConditionType) []enginev1.Condition

func EnsureOwnerRef

func EnsureOwnerRef(ownerReferences []metav1.OwnerReference, ref metav1.OwnerReference) []metav1.OwnerReference

EnsureOwnerRef makes sure the slice contains the OwnerReference.

func FullPatch

func FullPatch(ctx context.Context, c client.Client, obj, oldObj client.Object) error

func FullServerSideApply

func FullServerSideApply(ctx context.Context, c client.Client, obj client.Object, manager string) error

func GetAnnotatedObject

func GetAnnotatedObject(ctx context.Context, c client.Client, obj client.Object, annotationKey, annotationVal string, opts ...client.ListOption) (client.Object, error)

func HasChangesIn

func HasChangesIn(obj client.Object, patch client.Patch, keys []string) (bool, error)

func JobHasTerminated

func JobHasTerminated(job *batchv1.Job) bool

func JobIsActive

func JobIsActive(job *batchv1.Job) bool

func JobWasSuccessful

func JobWasSuccessful(job *batchv1.Job) bool

func LocalFunctionToObjectRef

func LocalFunctionToObjectRef(lref *meta.LocalObjectReference, namespace string) (*meta.ObjectReference, error)

func LocalMediaProcessingEntityToObjectRef

func LocalMediaProcessingEntityToObjectRef(lref *meta.LocalObjectReference, namespace string) (*meta.ObjectReference, error)

func MarkConditionFalse

func MarkConditionFalse(conditions []enginev1.Condition, t enginev1.ConditionType) []enginev1.Condition

func MarkConditionTrue

func MarkConditionTrue(conditions []enginev1.Condition, t enginev1.ConditionType) []enginev1.Condition

func MarkConditionUnknown

func MarkConditionUnknown(conditions []enginev1.Condition, t enginev1.ConditionType) []enginev1.Condition

func NormalizeExactRef

func NormalizeExactRef(s *runtime.Scheme, ref *meta.ExactObjectReference, obj client.Object) error

func NormalizeFunctionRef

func NormalizeFunctionRef(s *runtime.Scheme, ref *meta.ObjectReference) error

func NormalizeLocalFunctionRef

func NormalizeLocalFunctionRef(s *runtime.Scheme, ref *meta.LocalObjectReference) error

func NormalizeLocalMediaProcessingEntityRef

func NormalizeLocalMediaProcessingEntityRef(s *runtime.Scheme, ref *meta.LocalObjectReference) error

func NormalizeLocalRef

func NormalizeLocalRef(s *runtime.Scheme, ref *meta.LocalObjectReference, obj client.Object) error

func NormalizeLocalTaskTemplateRef

func NormalizeLocalTaskTemplateRef(s *runtime.Scheme, ref *meta.LocalObjectReference) error

func NormalizeMediaProcessingEntityRef

func NormalizeMediaProcessingEntityRef(s *runtime.Scheme, ref *meta.ObjectReference) error

func NormalizeRef

func NormalizeRef(s *runtime.Scheme, ref *meta.ObjectReference, obj client.Object) error

func NormalizeTaskTemplateRef

func NormalizeTaskTemplateRef(s *runtime.Scheme, ref *meta.ObjectReference) error

func PartiallyResolveLocalRef

func PartiallyResolveLocalRef(c client.Client, namespace string, ref *meta.LocalObjectReference) (client.Object, error)

func PartiallyResolveRef

func PartiallyResolveRef(c client.Client, ref *meta.ObjectReference) (client.Object, error)

func Patch

func Patch(ctx context.Context, c client.Client, obj, oldObj client.Object) error

func PatchStatus

func PatchStatus(ctx context.Context, c client.Client, obj, oldObj client.Object) error

func ResolveConfigMapOrSecretRefInline

func ResolveConfigMapOrSecretRefInline(ctx context.Context, c client.Client, ref *meta.ConfigMapOrSecretReference) error

func ResolveConfigMapRefInline

func ResolveConfigMapRefInline(ctx context.Context, c client.Client, ref *meta.ConfigMapOrSecretReference) error

func ResolveLocalRef

func ResolveLocalRef(ctx context.Context, c client.Client, namespace string, ref *meta.LocalObjectReference) (client.Object, error)

func ResolveRef

func ResolveRef(ctx context.Context, c client.Client, ref *meta.ObjectReference) (client.Object, error)

func ResolveSecretRefInline

func ResolveSecretRefInline(ctx context.Context, c client.Client, ref *meta.ConfigMapOrSecretReference) error

func SelectFunctionRef

func SelectFunctionRef(ctx context.Context, c client.Client, namespace string, sel labels.Selector) (*meta.ObjectReference, error)

func SelectMediaProcessingEntityRef

func SelectMediaProcessingEntityRef(ctx context.Context, c client.Client, namespace string, sel labels.Selector) (*meta.ObjectReference, error)

func ServerSideApply

func ServerSideApply(ctx context.Context, c client.Client, obj client.Object, manager string) error

func ServerSideApplyStatus

func ServerSideApplyStatus(ctx context.Context, c client.Client, obj client.Object, manager string) error

func SetCondition

func SetCondition(conditions []enginev1.Condition, cNew enginev1.Condition) []enginev1.Condition

func StrategicMerge

func StrategicMerge(original, modified, patchedObj any) error

func TaskHasTerminated

func TaskHasTerminated(task *enginev1.Task) bool

func TaskIsActive

func TaskIsActive(task *enginev1.Task) bool

func ToExactRef

func ToExactRef(obj client.Object) *meta.ExactObjectReference

func ToLocalRef

func ToLocalRef(obj client.Object) *meta.LocalObjectReference

func ToRef

func ToRef(obj client.Object) *meta.ObjectReference

func WorkflowHasTerminated

func WorkflowHasTerminated(wf *enginev1.Workflow) bool

func WorkflowIsActive

func WorkflowIsActive(wf *enginev1.Workflow) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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