helper

package
v2.14.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterReconcileWrapper

func ClusterReconcileWrapper(
	ctx context.Context,
	client ctrlruntimeclient.Client,
	workerName string,
	cluster *kubermaticv1.Cluster,
	conditionType kubermaticv1.ClusterConditionType,
	reconcile func() (*reconcile.Result, error)) (*reconcile.Result, error)

ClusterReconcileWrapper is a wrapper that should be used around any cluster reconciliaton. It: * Checks if the cluster is paused * Checks if the worker-name matches * Sets the ReconcileSuccess condition for the controller

func ClusterReconciliationSuccessful

func ClusterReconciliationSuccessful(cluster *kubermaticv1.Cluster) (missingConditions []kubermaticv1.ClusterConditionType, success bool)

func GetClusterCondition

func GetClusterCondition(c *kubermaticv1.Cluster, conditionType kubermaticv1.ClusterConditionType) (int, *kubermaticv1.ClusterCondition)

GetClusterCondition returns the index of the given condition or -1 and the condition itself or a nilpointer.

func GetHealthStatus

func GetHealthStatus(status kubermaticv1.HealthStatus, cluster *kubermaticv1.Cluster) kubermaticv1.HealthStatus

We assume that te cluster is still provisioning if it was not initialized fully at least once.

func IsClusterInitialized

func IsClusterInitialized(cluster *kubermaticv1.Cluster) bool

func SetClusterCondition

func SetClusterCondition(
	c *kubermaticv1.Cluster,
	conditionType kubermaticv1.ClusterConditionType,
	status corev1.ConditionStatus,
	reason string,
	message string,
)

SetClusterCondition sets a condition on the given cluster using the provided type, status, reason and message. It also adds the Kubermatic version and tiemstamps.

Types

This section is empty.

Jump to

Keyboard shortcuts

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