utils

package
v0.0.0-...-3981762 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	UPDATE = "Update"
	PATCH  = "Patch"
)

Resource operations

Variables

This section is empty.

Functions

func CreateK8sCR

func CreateK8sCR(ctx context.Context, c client.Client,
	newObject client.Object, ownerObject client.Object,
	operation string) (err error)

CreateK8sCR creates/updates/patches an object.

func DoesK8SResourceExist

func DoesK8SResourceExist(ctx context.Context, c client.Client, name, namespace string, obj client.Object) (resourceExists bool, err error)

func ExtractDataFromConfigMap

func ExtractDataFromConfigMap[T any](cm *corev1.ConfigMap, key string) (T, error)

func GetConfigmap

func GetConfigmap(ctx context.Context, c client.Client, name, namespace string) (*corev1.ConfigMap, error)

func SetStatusCondition

func SetStatusCondition(existingConditions *[]metav1.Condition, conditionType hwmgmtv1alpha1.ConditionType, conditionReason hwmgmtv1alpha1.ConditionReason, conditionStatus metav1.ConditionStatus, message string)

SetStatusCondition is a convenience wrapper for meta.SetStatusCondition that takes in the types defined here and converts them to strings

func UpdateK8sCRStatus

func UpdateK8sCRStatus(ctx context.Context, c client.Client, object client.Object) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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