contract

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package contract provides support for the ClusterReconciler to handle with providers objects according to the Cluster API contract.

Index

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

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

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

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

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

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

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 Path

type Path []string

Path defines a how to access a field in an Unstructured object.

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

Get gets the reference value from the Unstructured object.

func (*Ref) Path

func (r *Ref) Path() Path

Path returns the path of the reference.

func (*Ref) Set

func (r *Ref) Set(obj, refObj *unstructured.Unstructured) error

Set sets the reference value in the Unstructured object.

Jump to

Keyboard shortcuts

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