Documentation
¶
Index ¶
- Constants
- func AddFinalizer(obj metav1.Object, finalizers ...string)
- func CheckContainerRuntime(ctx context.Context, externalCluster *kubermaticv1.ExternalCluster, ...) (string, error)
- 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 GetDeploymentCondition(status appsv1.DeploymentStatus, condType appsv1.DeploymentConditionType) *appsv1.DeploymentCondition
- func GetNodeGroupReadyCount(nodes *corev1.NodeList, providerNodeLabel, providerNodePoolName string) int32
- 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 ValidateKubernetesToken(token string) error
- func ValidateSecretKeySelector(selector *providerconfig.GlobalSecretKeySelector, key string) error
- 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 CheckContainerRuntime ¶ added in v2.21.0
func CheckContainerRuntime(ctx context.Context, externalCluster *kubermaticv1.ExternalCluster, externalClusterProvider provider.ExternalClusterProvider, ) (string, error)
func ContainerFromString ¶ added in v2.20.0
func EnsureOwnerReference ¶ added in v2.21.0
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 ¶ added in v2.21.0
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 GetDeploymentCondition ¶ added in v2.17.0
func GetDeploymentCondition(status appsv1.DeploymentStatus, condType appsv1.DeploymentConditionType) *appsv1.DeploymentCondition
GetDeploymentCondition returns the condition with the provided type.
func GetNodeGroupReadyCount ¶ added in v2.21.0
func HasFinalizer ¶
HasFinalizer tells if a object has all the given finalizers.
func HasFinalizerSuperset ¶ added in v2.21.0
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 ¶ added in v2.21.0
func HasOwnerReference(o metav1.Object, ref metav1.OwnerReference) bool
func IsDeploymentRolloutComplete ¶ added in v2.17.0
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 ¶ added in v2.21.0
IsNodeReady returns true if a node is ready; false otherwise.
func RemoveFinalizer ¶
RemoveFinalizer removes the given finalizers from the object.
func RemoveOwnerReferenceKinds ¶ added in v2.21.0
func RemoveOwnerReferenceKinds(o metav1.Object, refKindsToRemove ...metav1.OwnerReference)
RemoveOwnerReferenceKinds removes any reference with the same APIVersion and Kind, notably ignoring the name.
func RemoveOwnerReferences ¶ added in v2.21.0
func RemoveOwnerReferences(o metav1.Object, refToRemoves ...metav1.OwnerReference)
RemoveOwnerReference removes any reference that has the same APIVersion, Kind and Name.
func SortOwnerReferences ¶ added in v2.21.0
func SortOwnerReferences(refs []metav1.OwnerReference)
func TryAddFinalizer ¶ added in v2.21.0
func TryAddFinalizer(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, finalizers ...string) error
func TryRemoveFinalizer ¶ added in v2.21.0
func TryRemoveFinalizer(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, finalizers ...string) error
func ValidateKubernetesToken ¶
ValidateKubernetesToken checks if a given token is syntactically correct.
func ValidateSecretKeySelector ¶
func ValidateSecretKeySelector(selector *providerconfig.GlobalSecretKeySelector, key string) error
Types ¶
type SeedClientMap ¶ added in v2.21.0
type SeedClientMap map[string]ctrlruntimeclient.Client
func (SeedClientMap) Each ¶ added in v2.21.0
func (m SeedClientMap) Each(ctx context.Context, log *zap.SugaredLogger, visitor SeedVisitorFunc) error
type SeedVisitorFunc ¶ added in v2.21.0
type SeedVisitorFunc func(seedName string, seedClient ctrlruntimeclient.Client, log *zap.SugaredLogger) error