resourceutil

package
v0.86.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PipelineCompletedCondition = clusterv1.ConditionType("PipelineCompleted")
	ManualReconciliationLabel  = "kratix.io/manual-reconciliation"
)

Variables

This section is empty.

Functions

func DoesNotContainFinalizer

func DoesNotContainFinalizer(resource client.Object, finalizer string) bool

func FinalizersAreDeleted

func FinalizersAreDeleted(resource client.Object, finalizers []string) bool

func FinalizersAreMissing

func FinalizersAreMissing(resource client.Object, finalizers []string) bool

func GenerateObjectName added in v0.67.0

func GenerateObjectName(name string) string

func GetAllWorksForResource added in v0.67.0

func GetAllWorksForResource(k8sClient client.Client, namespace, promiseName, resourceName string) ([]v1alpha1.Work, error)

func GetCondition

func GetCondition(obj *unstructured.Unstructured, conditionType clusterv1.ConditionType) *clusterv1.Condition

func GetObservedGeneration added in v0.76.0

func GetObservedGeneration(rr *unstructured.Unstructured) int64

GetObservedGeneration returns 0 when either status or status.observedGeneration is nil

func GetPipelineCompletedConditionStatus

func GetPipelineCompletedConditionStatus(obj *unstructured.Unstructured) v1.ConditionStatus

func GetResourceNames

func GetResourceNames(items []unstructured.Unstructured) []string

func GetStatus added in v0.67.0

func GetStatus(rr *unstructured.Unstructured, key string) string

func GetWorkForPromisePipeline added in v0.67.0

func GetWorkForPromisePipeline(k8sClient client.Client, namespace, promiseName, pipelineName string) (*v1alpha1.Work, error)

func GetWorkForResourcePipeline added in v0.67.0

func GetWorkForResourcePipeline(k8sClient client.Client, namespace, promiseName, resourceName, pipelineName string) (*v1alpha1.Work, error)

func GetWorkForStaticDependencies added in v0.67.0

func GetWorkForStaticDependencies(k8sClient client.Client, namespace, promiseName string) (*v1alpha1.Work, error)

func GetWorksByType added in v0.67.0

func GetWorksByType(k8sClient client.Client, workflowType v1alpha1.Type, obj *unstructured.Unstructured) ([]v1alpha1.Work, error)

func HasCondition

func HasCondition(obj *unstructured.Unstructured, conditionType clusterv1.ConditionType) bool

func IsPromiseMarkedAsUnavailable added in v0.1.0

func IsPromiseMarkedAsUnavailable(obj *unstructured.Unstructured) bool

func IsThereAPipelineRunning

func IsThereAPipelineRunning(logger logr.Logger, jobs []batchv1.Job) bool

func MarkPipelineAsCompleted

func MarkPipelineAsCompleted(logger logr.Logger, obj *unstructured.Unstructured)

func MarkPipelineAsRunning

func MarkPipelineAsRunning(logger logr.Logger, obj *unstructured.Unstructured)

func MarkPromiseConditionAsAvailable added in v0.1.0

func MarkPromiseConditionAsAvailable(obj *unstructured.Unstructured, logger logr.Logger)

func MarkPromiseConditionAsNotAvailable added in v0.1.0

func MarkPromiseConditionAsNotAvailable(obj *unstructured.Unstructured, logger logr.Logger)

func PipelineWithDesiredSpecExists

func PipelineWithDesiredSpecExists(logger logr.Logger, obj *unstructured.Unstructured, jobs []batchv1.Job) (*batchv1.Job, error)

func SetCondition

func SetCondition(obj *unstructured.Unstructured, condition *clusterv1.Condition)

func SetPromiseWorkLabels added in v0.67.0

func SetPromiseWorkLabels(l map[string]string, promiseName, pipelineName string)

func SetResourceWorkLabels added in v0.67.0

func SetResourceWorkLabels(l map[string]string, promiseName, resourceName, pipelineName string)

func SetStaticDependencyWorkLabels added in v0.67.0

func SetStaticDependencyWorkLabels(l map[string]string, promiseName string)

func SetStatus

func SetStatus(rr *unstructured.Unstructured, logger logr.Logger, statuses ...interface{})

SetStatus takes in key value pairs in the statuses argument. Example: key1, value1, key2, value2, ... All keys must be castable to string. Values can be any type.

func SortJobsByCreationDateTime added in v0.44.0

func SortJobsByCreationDateTime(jobs []batchv1.Job, desc bool) []batchv1.Job

func SuspendablePipelines

func SuspendablePipelines(logger logr.Logger, jobs []batchv1.Job) []batchv1.Job

If a job has no active pods we can suspend it

Types

This section is empty.

Jump to

Keyboard shortcuts

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