Documentation ¶
Overview ¶
Package util implements kubeadm utility functionality.
Index ¶
- type ConfigOwner
- func GetConfigOwner(ctx context.Context, c client.Client, obj metav1.Object) (*ConfigOwner, error)
- func GetOwnerByRef(ctx context.Context, c client.Client, ref *corev1.ObjectReference) (*ConfigOwner, error)
- func GetTypedConfigOwner(ctx context.Context, c client.Client, obj metav1.Object) (*ConfigOwner, error)
- func GetTypedOwnerByRef(ctx context.Context, c client.Client, ref *corev1.ObjectReference) (*ConfigOwner, error)
- func (co ConfigOwner) ClusterName() string
- func (co ConfigOwner) DataSecretName() *string
- func (co ConfigOwner) HasNodeRefs() bool
- func (co ConfigOwner) IsControlPlaneMachine() bool
- func (co ConfigOwner) IsInfrastructureReady() bool
- func (co ConfigOwner) IsMachinePool() bool
- func (co ConfigOwner) KubernetesVersion() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigOwner ¶
type ConfigOwner struct {
*unstructured.Unstructured
}
ConfigOwner provides a data interface for different config owner types.
func GetConfigOwner ¶
GetConfigOwner returns the Unstructured object owning the current resource using the uncached unstructured client. For performance-sensitive uses, consider GetTypedConfigOwner.
func GetOwnerByRef ¶
func GetOwnerByRef(ctx context.Context, c client.Client, ref *corev1.ObjectReference) (*ConfigOwner, error)
GetOwnerByRef finds and returns the owner by looking at the object reference.
func GetTypedConfigOwner ¶ added in v1.5.0
func GetTypedConfigOwner(ctx context.Context, c client.Client, obj metav1.Object) (*ConfigOwner, error)
GetTypedConfigOwner returns the Unstructured object owning the current resource. The implementation ensures a typed client is used, so the objects are read from the cache.
func GetTypedOwnerByRef ¶ added in v1.5.0
func GetTypedOwnerByRef(ctx context.Context, c client.Client, ref *corev1.ObjectReference) (*ConfigOwner, error)
GetTypedOwnerByRef finds and returns the owner by looking at the object reference. The implementation ensures a typed client is used, so the objects are read from the cache.
func (ConfigOwner) ClusterName ¶
func (co ConfigOwner) ClusterName() string
ClusterName extracts spec.clusterName from the config owner.
func (ConfigOwner) DataSecretName ¶
func (co ConfigOwner) DataSecretName() *string
DataSecretName extracts spec.bootstrap.dataSecretName from the config owner.
func (ConfigOwner) HasNodeRefs ¶ added in v1.1.5
func (co ConfigOwner) HasNodeRefs() bool
HasNodeRefs checks if the config owner has nodeRefs. For a Machine this means that it has a nodeRef. For a MachinePool it means that it has as many nodeRefs as there are replicas.
func (ConfigOwner) IsControlPlaneMachine ¶
func (co ConfigOwner) IsControlPlaneMachine() bool
IsControlPlaneMachine checks if an unstructured object is Machine with the control plane role.
func (ConfigOwner) IsInfrastructureReady ¶
func (co ConfigOwner) IsInfrastructureReady() bool
IsInfrastructureReady extracts infrastructure status from the config owner.
func (ConfigOwner) IsMachinePool ¶ added in v0.3.12
func (co ConfigOwner) IsMachinePool() bool
IsMachinePool checks if an unstructured object is a MachinePool.
func (ConfigOwner) KubernetesVersion ¶ added in v0.3.15
func (co ConfigOwner) KubernetesVersion() string
KubernetesVersion returns the Kuberentes version for the config owner object.