Documentation ¶
Index ¶
- Constants
- func AddFinalizer(obj metav1.Object, finalizers ...string)
- func ContainerFromString(containerSpec string) (*corev1.Container, error)
- func EnsureLabels(o metav1.Object, toEnsure map[string]string)
- func EnsureOwnerReference(o metav1.Object, ref metav1.OwnerReference)
- func EnsureUniqueOwnerReference(o metav1.Object, ref metav1.OwnerReference)
- func GenerateToken() string
- func GetClusterClient(ctx context.Context, cluster *kubermaticv1.ExternalCluster, ...) (*kubernetes.Clientset, error)
- func GetContainerRuntime(ctx context.Context, clusterClient *kubernetes.Clientset) (string, error)
- func GetDeploymentCondition(status appsv1.DeploymentStatus, condType appsv1.DeploymentConditionType) *appsv1.DeploymentCondition
- func GetNodeGroupReadyCount(nodes *corev1.NodeList, providerNodeLabel, providerNodePoolName string) int32
- func GetVersion(client *kubernetes.Clientset) (*ksemver.Semver, error)
- func HasAnyFinalizer(o metav1.Object, names ...string) bool
- func HasFinalizer(o metav1.Object, names ...string) bool
- func HasFinalizerSuperset(o metav1.Object, names ...string) bool
- func HasOnlyFinalizer(o metav1.Object, names ...string) bool
- func HasOwnerReference(o metav1.Object, ref metav1.OwnerReference) bool
- func IsDeploymentRolloutComplete(deployment *appsv1.Deployment, revision int64) (bool, error)
- func IsNodeReady(node *corev1.Node) bool
- func RemoveFinalizer(obj metav1.Object, toRemove ...string)
- func RemoveOwnerReferenceKinds(o metav1.Object, refKindsToRemove ...metav1.OwnerReference)
- func RemoveOwnerReferences(o metav1.Object, refToRemoves ...metav1.OwnerReference)
- func Revision(obj runtime.Object) (int64, error)
- func SortOwnerReferences(refs []metav1.OwnerReference)
- func TryAddFinalizer(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func TryRemoveFinalizer(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func UpdateClusterStatus(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func UpdateDatacenterStatus(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func UpdateKubermaticConfigurationStatus(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func ValidateKubernetesToken(token string) error
- func ValidateSecretKeySelector(selector *kubermaticv1.GlobalSecretKeySelector, key string) error
- type ClusterPatchFunc
- type DatacenterPatchFunc
- type KubermaticConfigurationPatchFunc
- type SeedClientMap
- type SeedVisitorFunc
Constants ¶
const ( // RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence. RevisionAnnotation = "deployment.kubernetes.io/revision" // NodeControlPlaneLabel is the label on kubernetes control plane nodes. NodeControlPlaneLabel = "node-role.kubernetes.io/control-plane" )
Variables ¶
This section is empty.
Functions ¶
func AddFinalizer ¶
AddFinalizer will add the given finalizer to the object. It uses a StringSet to avoid duplicates.
func ContainerFromString ¶
func EnsureOwnerReference ¶
func EnsureOwnerReference(o metav1.Object, ref metav1.OwnerReference)
EnsureOwnerReference will add the given owner reference to the object if it doesn't exist yet. Other references with the same name can exist.
func EnsureUniqueOwnerReference ¶
func EnsureUniqueOwnerReference(o metav1.Object, ref metav1.OwnerReference)
EnsureUniqueOwnerReference will remove any owner ref with the same APIVersion and Kind, and then add the given ref to the owner references. This ensures that only one ref with a given kind exists.
func GenerateToken ¶
func GenerateToken() string
GenerateToken generates a new, random token that can be used as an admin and kubelet token.
func GetClusterClient ¶
func GetClusterClient(ctx context.Context, cluster *kubermaticv1.ExternalCluster, masterClient ctrlruntimeclient.Client) (*kubernetes.Clientset, error)
func GetContainerRuntime ¶
func GetDeploymentCondition ¶
func GetDeploymentCondition(status appsv1.DeploymentStatus, condType appsv1.DeploymentConditionType) *appsv1.DeploymentCondition
GetDeploymentCondition returns the condition with the provided type.
func GetNodeGroupReadyCount ¶
func GetVersion ¶
func GetVersion(client *kubernetes.Clientset) (*ksemver.Semver, error)
func HasFinalizer ¶
HasFinalizer tells if a object has all the given finalizers.
func HasFinalizerSuperset ¶
HasFinalizerSuperset tells if the given finalizer(s) are a superset of the actual finalizers.
func HasOnlyFinalizer ¶
HasOnlyFinalizer tells if an object has only the given finalizer(s).
func HasOwnerReference ¶
func HasOwnerReference(o metav1.Object, ref metav1.OwnerReference) bool
func IsDeploymentRolloutComplete ¶
func IsDeploymentRolloutComplete(deployment *appsv1.Deployment, revision int64) (bool, error)
IsDeploymentRolloutComplete returns a bool saying whether the deployment completed and an error in case an unexpected condition arrives.
func IsNodeReady ¶
IsNodeReady returns true if a node is ready; false otherwise.
func RemoveFinalizer ¶
RemoveFinalizer removes the given finalizers from the object.
func RemoveOwnerReferenceKinds ¶
func RemoveOwnerReferenceKinds(o metav1.Object, refKindsToRemove ...metav1.OwnerReference)
RemoveOwnerReferenceKinds removes any reference with the same APIVersion and Kind, notably ignoring the name.
func RemoveOwnerReferences ¶
func RemoveOwnerReferences(o metav1.Object, refToRemoves ...metav1.OwnerReference)
RemoveOwnerReference removes any reference that has the same APIVersion, Kind and Name.
func SortOwnerReferences ¶
func SortOwnerReferences(refs []metav1.OwnerReference)
func TryAddFinalizer ¶
func TryAddFinalizer(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, finalizers ...string) error
func TryRemoveFinalizer ¶
func TryRemoveFinalizer(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, finalizers ...string) error
func UpdateClusterStatus ¶
func UpdateClusterStatus(ctx context.Context, client ctrlruntimeclient.Client, cluster *kubermaticv1.Cluster, patch ClusterPatchFunc) error
UpdateClusterStatus will attempt to patch the cluster status of the given cluster.
func UpdateDatacenterStatus ¶
func UpdateDatacenterStatus(ctx context.Context, client ctrlruntimeclient.Client, datacenter *kubermaticv1.Datacenter, patch DatacenterPatchFunc) error
func UpdateKubermaticConfigurationStatus ¶
func UpdateKubermaticConfigurationStatus(ctx context.Context, client ctrlruntimeclient.Client, kc *kubermaticv1.KubermaticConfiguration, patch KubermaticConfigurationPatchFunc, ) error
func ValidateKubernetesToken ¶
ValidateKubernetesToken checks if a given token is syntactically correct.
func ValidateSecretKeySelector ¶
func ValidateSecretKeySelector(selector *kubermaticv1.GlobalSecretKeySelector, key string) error
Types ¶
type ClusterPatchFunc ¶
type ClusterPatchFunc func(cluster *kubermaticv1.Cluster)
type DatacenterPatchFunc ¶
type DatacenterPatchFunc func(datacenter *kubermaticv1.Datacenter)
type KubermaticConfigurationPatchFunc ¶
type KubermaticConfigurationPatchFunc func(kc *kubermaticv1.KubermaticConfiguration)
type SeedClientMap ¶
type SeedClientMap map[string]ctrlruntimeclient.Client
func (SeedClientMap) Each ¶
func (m SeedClientMap) Each(ctx context.Context, log *zap.SugaredLogger, visitor SeedVisitorFunc) error
type SeedVisitorFunc ¶
type SeedVisitorFunc func(seedName string, seedClient ctrlruntimeclient.Client, log *zap.SugaredLogger) error