util

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToExistingSans added in v1.5.4

func AddToExistingSans(existing []string, new []string) []string

AddToExistingSans merges original sans list with a new sans slice avoiding duplicated values.

func AnnotationsForK0smotronCluster added in v1.4.0

func AnnotationsForK0smotronCluster(kmc *km.Cluster) map[string]string

func DefaultK0smotronClusterLabels added in v1.4.0

func DefaultK0smotronClusterLabels(kmc *km.Cluster) map[string]string

func DownloadCommands added in v1.5.4

func DownloadCommands(preInstalledK0s bool, url string, version string) []string

DownloadCommands constructs the download commands for a given URL and version.

func EnsureFinalizer added in v1.5.4

func EnsureFinalizer(ctx context.Context, c client.Client, o client.Object, finalizer string) (finalizerAdded bool, err error)

EnsureFinalizer adds a finalizer if the object doesn't have a deletionTimestamp set and if the finalizer is not already set. This util is usually used in reconcilers directly after the reconciled object was retrieved and before pause is handled or "defer patch" with the patch helper.

TODO: This function is copied from https://github.com/kubernetes-sigs/cluster-api/blob/v1.9.0/util/finalizers/finalizers.go. Use it once the CAPI dependency is bumped to >=v1.9.0.

func FindNodeAddress added in v0.7.0

func FindNodeAddress(nodes *v1.NodeList) string

FindNodeAddress returns a random node address preferring external address if one is found

func FindStatefulSetPod

func FindStatefulSetPod(ctx context.Context, clientSet *kubernetes.Clientset, statefulSet string, namespace string) (*v1.Pod, error)

FindStatefulSetPod returns a first running pod from a StatefulSet

func GetKubeClient added in v1.0.2

func GetKubeClient(ctx context.Context, client client.Client, cluster *clusterv1.Cluster) (*kubernetes.Clientset, error)

func LabelsForEtcdK0smotronCluster added in v1.4.0

func LabelsForEtcdK0smotronCluster(kmc *km.Cluster) map[string]string

func LabelsForK0smotronCluster added in v1.4.0

func LabelsForK0smotronCluster(kmc *km.Cluster) map[string]string

func LabelsForK0smotronControlPlane added in v1.4.0

func LabelsForK0smotronControlPlane(kmc *km.Cluster) map[string]string

Types

This section is empty.

Jump to

Keyboard shortcuts

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