Documentation ¶
Overview ¶
Package contract provides support for the ClusterReconciler to handle with providers objects according to the Cluster API contract.
Index ¶
- func GetNestedRef(obj *unstructured.Unstructured, fields ...string) (*corev1.ObjectReference, error)
- func ObjToRef(obj client.Object) *corev1.ObjectReference
- func SetNestedRef(obj, refObj *unstructured.Unstructured, fields ...string) error
- type ControlPlaneContract
- type ControlPlaneReplicas
- type ControlPlaneTemplateContract
- type ControlPlaneVersion
- type InfrastructureClusterContract
- type Path
- type Ref
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNestedRef ¶
func GetNestedRef(obj *unstructured.Unstructured, fields ...string) (*corev1.ObjectReference, error)
GetNestedRef returns the ref value from a nested field in an Unstructured object.
func ObjToRef ¶
func ObjToRef(obj client.Object) *corev1.ObjectReference
ObjToRef returns a reference to the given object.
func SetNestedRef ¶
func SetNestedRef(obj, refObj *unstructured.Unstructured, fields ...string) error
SetNestedRef sets the value of a nested field in an Unstructured to a reference to the refObj provided.
Types ¶
type ControlPlaneContract ¶
type ControlPlaneContract struct{}
ControlPlaneContract encodes information about the Cluster API contract for ControlPlane objects like e.g the KubeadmControlPlane etc.
func ControlPlane ¶
func ControlPlane() *ControlPlaneContract
ControlPlane provide access to the information about the Cluster API contract for ControlPlane objects.
func (*ControlPlaneContract) InfrastructureMachineTemplate ¶
func (c *ControlPlaneContract) InfrastructureMachineTemplate() *Ref
InfrastructureMachineTemplate provide access to InfrastructureMachineTemplate reference in a ControlPlane object, if any. NOTE: When working with unstructured there is no way to understand if the ControlPlane provider do support a field in the type definition from the fact that a field is not set in a given instance. This is why in we are deriving if InfrastructureMachineTemplate is required from the ClusterClass in the topology reconciler code.
func (*ControlPlaneContract) Replicas ¶
func (c *ControlPlaneContract) Replicas() *ControlPlaneReplicas
Replicas provide access to replicas field in a ControlPlane object, if any. NOTE: When working with unstructured there is no way to understand if the ControlPlane provider do support a field in the type definition from the fact that a field is not set in a given instance. This is why in we are deriving if replicas is required from the ClusterClass in the topology reconciler code.
func (*ControlPlaneContract) Version ¶
func (c *ControlPlaneContract) Version() *ControlPlaneVersion
Version provide access to version field in a ControlPlane object, if any. NOTE: When working with unstructured there is no way to understand if the ControlPlane provider do support a field in the type definition from the fact that a field is not set in a given instance. This is why in we are deriving if version is required from the ClusterClass in the topology reconciler code.
type ControlPlaneReplicas ¶
type ControlPlaneReplicas struct{}
ControlPlaneReplicas provide a helper struct for working with version in ClusterClass.
func (*ControlPlaneReplicas) Get ¶
func (r *ControlPlaneReplicas) Get(obj *unstructured.Unstructured) (*int64, error)
Get gets the replicas value from the ControlPlane object.
func (*ControlPlaneReplicas) Path ¶
func (r *ControlPlaneReplicas) Path() Path
Path returns the path of the reference.
func (*ControlPlaneReplicas) Set ¶
func (r *ControlPlaneReplicas) Set(obj *unstructured.Unstructured, value int64) error
Set sets the replica value in the ControlPlane object.
type ControlPlaneTemplateContract ¶
type ControlPlaneTemplateContract struct{}
ControlPlaneTemplateContract encodes information about the Cluster API contract for ControlPlaneTemplate objects like e.g. the KubeadmControlPlane etc.
func ControlPlaneTemplate ¶
func ControlPlaneTemplate() *ControlPlaneTemplateContract
ControlPlaneTemplate provide access to the information about the Cluster API contract for ControlPlaneTemplate objects.
func (*ControlPlaneTemplateContract) InfrastructureMachineTemplate ¶
func (c *ControlPlaneTemplateContract) InfrastructureMachineTemplate() *Ref
InfrastructureMachineTemplate provide access to InfrastructureMachineTemplate reference, if any. NOTE: When working with unstructured there is no way to understand if the ControlPlane provider do support a field in the type definition from the fact that a field is not set in a given instance. This is why in we are deriving if this field is required from the ClusterClass in the topology reconciler code.
type ControlPlaneVersion ¶
type ControlPlaneVersion struct{}
ControlPlaneVersion provide a helper struct for working with version in ClusterClass.
func (*ControlPlaneVersion) Get ¶
func (v *ControlPlaneVersion) Get(obj *unstructured.Unstructured) (*string, error)
Get gets the version value from the ControlPlane object.
func (*ControlPlaneVersion) Path ¶
func (v *ControlPlaneVersion) Path() Path
Path returns the path of the reference.
func (*ControlPlaneVersion) Set ¶
func (v *ControlPlaneVersion) Set(obj *unstructured.Unstructured, value string) error
Set sets the version value in the ControlPlane object.
type InfrastructureClusterContract ¶
type InfrastructureClusterContract struct{}
InfrastructureClusterContract encodes information about the Cluster API contract for InfrastructureCluster objects like e.g the DockerCluster, AWS Cluster etc.
func InfrastructureCluster ¶
func InfrastructureCluster() *InfrastructureClusterContract
InfrastructureCluster provide access to the information about the Cluster API contract for InfrastructureCluster objects.
func (*InfrastructureClusterContract) IgnorePaths ¶
func (c *InfrastructureClusterContract) IgnorePaths() []Path
IgnorePaths returns a list of paths to be ignored when reconciling a topology.
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
Ref provide a helper struct for working with references in Unstructured objects.
func (*Ref) Get ¶
func (r *Ref) Get(obj *unstructured.Unstructured) (*corev1.ObjectReference, error)
Get gets the reference value from the Unstructured object.
func (*Ref) Set ¶
func (r *Ref) Set(obj, refObj *unstructured.Unstructured) error
Set sets the reference value in the Unstructured object.