controller

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: EUPL-1.2 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHashSuffix

func AddHashSuffix(obj client.Object) error

func CloneOrEmptyMap

func CloneOrEmptyMap[K comparable, V any](m map[K]V) map[K]V

func CombineLabels added in v1.2.10

func CombineLabels(labelSets ...map[string]string) map[string]string

CombineLabels combines multiple sets of labels into one set of labels if a label key exists in multiple labelSets, the value of last labelSet with that key will be returned

func CreateIngressRuleAndStripPrefixForBaseURL

func CreateIngressRuleAndStripPrefixForBaseURL(url url.URL, includeLocalhost, matchUnderscoreVersions, traefikV2 bool) (string, string)

func CreateRegexpForUnderscoreVersions

func CreateRegexpForUnderscoreVersions(path string) string

func CreateUnstructuredWithGroupVersionKind added in v1.2.4

func CreateUnstructuredWithGroupVersionKind(gvr schema.GroupVersionResource, kind string) (obj *unstructured.Unstructured)

func DeleteObjects

func DeleteObjects(ctx context.Context, c client.Client, objects []client.Object) (err error)

func EnsureSetGVK

func EnsureSetGVK(c client.Client, src client.Object, obj schema.ObjectKind) error

func FinalizeIfNecessary

func FinalizeIfNecessary(ctx context.Context, c client.Client, obj client.Object, finalizerName string, finalizer func() error) (shouldContinue bool, err error)

func GenerateHashFromStrings

func GenerateHashFromStrings(sliceToHash []string) string

GenerateHashFromStrings generates a hash from a list of strings. This hash can be used to identify resources and if they can be removed. E.g. the ogcapi-operator provides the volume-operator with a hash so it knows what resources to create or remove.

func GetObjectFullName

func GetObjectFullName(c client.Client, obj client.Object) string

func IntOrStrStrPtr

func IntOrStrStrPtr(s string) *intstr.IntOrString

func KustomizeHash

func KustomizeHash(obj client.Object) (hash string, err error)

kustomizeHash aims to calculate a hash for an object the same way kustomize does. please make sure your object has its Kind set.

func Pointer

func Pointer[T any](val T) *T

func PointerVal

func PointerVal[T any](val *T, defaultValue T) T

func SetImmutableLabels deprecated

func SetImmutableLabels(c client.Client, obj client.Object, labels map[string]string) error

SetImmutableLabels

Deprecated: immutability check can cause conflicts with external mutators, use CombineLabels instead

func SplitHashSuffix

func SplitHashSuffix(in string) (name, hash string)

func StrategicMergePatch

func StrategicMergePatch[T, P any](obj *T, patch *P) (*T, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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