utils

package
v0.119.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToAnyJSON

func BoolToAnyJSON(b bool) lsv1alpha1.AnyJSON

BoolToAnyJSON marshals a boolean as an AnyJSON object.

func ContainsReference

func ContainsReference(refList []lssv1alpha1.ObjectReference, ref *lssv1alpha1.ObjectReference) bool

ContainsReference checks whether the object reference list contains the specified object reference.

func GetMapValues

func GetMapValues[E comparable, F any](m map[E]F) []F

GetMapValues returns a slice with the values of the given map.

func HasDeleteWithoutUninstallAnnotation

func HasDeleteWithoutUninstallAnnotation(obj metav1.Object) bool

HasDeleteWithoutUninstallAnnotation returns true only if the given object has the 'landscaper.gardener.cloud/delete-without-uninstall' annotation and its value is 'true'.

func HasLabel

func HasLabel(obj metav1.Object, lab string) bool

HasLabel checks if the objects has a label

func HasLabelWithValue

func HasLabelWithValue(obj metav1.Object, name string, value string) bool

func HasOperationAnnotation

func HasOperationAnnotation(object client.Object, operation string) bool

HasOperationAnnotation returns true if the object has provided operation annotation set.

func IntToAnyJSON

func IntToAnyJSON(i int) lsv1alpha1.AnyJSON

IntToAnyJSON marshals an integer as an AnyJSON object.

func NewUncachedClient

func NewUncachedClient(config *rest.Config, options client.Options) (client.Client, error)

func RemoveOperationAnnotation

func RemoveOperationAnnotation(object client.Object)

RemoveOperationAnnotation removes the operation annotation if it exists.

func RemoveReference

RemoveReference removes the given object reference from the object reference list if contained.

func SetOperationAnnotation

func SetOperationAnnotation(object client.Object, operation string)

SetOperationAnnotation sets the provided operation annotation.

func StringToAnyJSON

func StringToAnyJSON(s string) lsv1alpha1.AnyJSON

StringToAnyJSON marshals a string as an AnyJSON object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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