Documentation ¶
Overview ¶
Package builder implements builder and CRDs for creating API objects for testing.
Index ¶
- Variables
- type BootstrapTemplateBuilder
- type ClusterBuilder
- func (c *ClusterBuilder) Build() *clusterv1.Cluster
- func (c *ClusterBuilder) WithControlPlane(t *unstructured.Unstructured) *ClusterBuilder
- func (c *ClusterBuilder) WithInfrastructureCluster(t *unstructured.Unstructured) *ClusterBuilder
- func (c *ClusterBuilder) WithLabels(labels map[string]string) *ClusterBuilder
- func (c *ClusterBuilder) WithTopology(topology *clusterv1.Topology) *ClusterBuilder
- type ClusterClassBuilder
- func (c *ClusterClassBuilder) Build() *clusterv1.ClusterClass
- func (c *ClusterClassBuilder) WithControlPlaneInfrastructureMachineTemplate(t *unstructured.Unstructured) *ClusterClassBuilder
- func (c *ClusterClassBuilder) WithControlPlaneMachineHealthCheck(mhc *clusterv1.MachineHealthCheckClass) *ClusterClassBuilder
- func (c *ClusterClassBuilder) WithControlPlaneMetadata(labels, annotations map[string]string) *ClusterClassBuilder
- func (c *ClusterClassBuilder) WithControlPlaneTemplate(t *unstructured.Unstructured) *ClusterClassBuilder
- func (c *ClusterClassBuilder) WithInfrastructureClusterTemplate(t *unstructured.Unstructured) *ClusterClassBuilder
- func (c *ClusterClassBuilder) WithPatches(patches []clusterv1.ClusterClassPatch) *ClusterClassBuilder
- func (c *ClusterClassBuilder) WithVariables(vars ...clusterv1.ClusterClassVariable) *ClusterClassBuilder
- func (c *ClusterClassBuilder) WithWorkerMachineDeploymentClasses(mdcs ...clusterv1.MachineDeploymentClass) *ClusterClassBuilder
- type ClusterTopologyBuilder
- func (c *ClusterTopologyBuilder) Build() *clusterv1.Topology
- func (c *ClusterTopologyBuilder) WithClass(class string) *ClusterTopologyBuilder
- func (c *ClusterTopologyBuilder) WithControlPlaneReplicas(replicas int32) *ClusterTopologyBuilder
- func (c *ClusterTopologyBuilder) WithMachineDeployment(mdc clusterv1.MachineDeploymentTopology) *ClusterTopologyBuilder
- func (c *ClusterTopologyBuilder) WithVariables(vars ...clusterv1.ClusterVariable) *ClusterTopologyBuilder
- func (c *ClusterTopologyBuilder) WithVersion(version string) *ClusterTopologyBuilder
- type ControlPlaneBuilder
- func (f *ControlPlaneBuilder) Build() *unstructured.Unstructured
- func (f *ControlPlaneBuilder) WithInfrastructureMachineTemplate(t *unstructured.Unstructured) *ControlPlaneBuilder
- func (f *ControlPlaneBuilder) WithReplicas(replicas int64) *ControlPlaneBuilder
- func (f *ControlPlaneBuilder) WithSpecFields(m map[string]interface{}) *ControlPlaneBuilder
- func (f *ControlPlaneBuilder) WithStatusFields(m map[string]interface{}) *ControlPlaneBuilder
- func (f *ControlPlaneBuilder) WithVersion(version string) *ControlPlaneBuilder
- type ControlPlaneTemplateBuilder
- func (c *ControlPlaneTemplateBuilder) Build() *unstructured.Unstructured
- func (c *ControlPlaneTemplateBuilder) WithInfrastructureMachineTemplate(t *unstructured.Unstructured) *ControlPlaneTemplateBuilder
- func (c *ControlPlaneTemplateBuilder) WithSpecFields(fields map[string]interface{}) *ControlPlaneTemplateBuilder
- type InfrastructureClusterBuilder
- type InfrastructureClusterTemplateBuilder
- type InfrastructureMachineTemplateBuilder
- type MachineDeploymentBuilder
- func (m *MachineDeploymentBuilder) Build() *clusterv1.MachineDeployment
- func (m *MachineDeploymentBuilder) WithBootstrapTemplate(ref *unstructured.Unstructured) *MachineDeploymentBuilder
- func (m *MachineDeploymentBuilder) WithGeneration(generation int64) *MachineDeploymentBuilder
- func (m *MachineDeploymentBuilder) WithInfrastructureTemplate(ref *unstructured.Unstructured) *MachineDeploymentBuilder
- func (m *MachineDeploymentBuilder) WithLabels(labels map[string]string) *MachineDeploymentBuilder
- func (m *MachineDeploymentBuilder) WithReplicas(replicas int32) *MachineDeploymentBuilder
- func (m *MachineDeploymentBuilder) WithStatus(status clusterv1.MachineDeploymentStatus) *MachineDeploymentBuilder
- func (m *MachineDeploymentBuilder) WithVersion(version string) *MachineDeploymentBuilder
- type MachineDeploymentClassBuilder
- func (m *MachineDeploymentClassBuilder) Build() *clusterv1.MachineDeploymentClass
- func (m *MachineDeploymentClassBuilder) WithAnnotations(annotations map[string]string) *MachineDeploymentClassBuilder
- func (m *MachineDeploymentClassBuilder) WithBootstrapTemplate(t *unstructured.Unstructured) *MachineDeploymentClassBuilder
- func (m *MachineDeploymentClassBuilder) WithInfrastructureTemplate(t *unstructured.Unstructured) *MachineDeploymentClassBuilder
- func (m *MachineDeploymentClassBuilder) WithLabels(labels map[string]string) *MachineDeploymentClassBuilder
- func (m *MachineDeploymentClassBuilder) WithMachineHealthCheckClass(mhc *clusterv1.MachineHealthCheckClass) *MachineDeploymentClassBuilder
- type MachineDeploymentTopologyBuilder
- func (m *MachineDeploymentTopologyBuilder) Build() clusterv1.MachineDeploymentTopology
- func (m *MachineDeploymentTopologyBuilder) WithClass(class string) *MachineDeploymentTopologyBuilder
- func (m *MachineDeploymentTopologyBuilder) WithReplicas(replicas int32) *MachineDeploymentTopologyBuilder
- func (m *MachineDeploymentTopologyBuilder) WithVariables(variables ...clusterv1.ClusterVariable) *MachineDeploymentTopologyBuilder
- type MachineHealthCheckBuilder
- func (m *MachineHealthCheckBuilder) Build() *clusterv1.MachineHealthCheck
- func (m *MachineHealthCheckBuilder) WithClusterName(clusterName string) *MachineHealthCheckBuilder
- func (m *MachineHealthCheckBuilder) WithMaxUnhealthy(maxUnhealthy *intstr.IntOrString) *MachineHealthCheckBuilder
- func (m *MachineHealthCheckBuilder) WithOwnerReferences(ownerRefs []metav1.OwnerReference) *MachineHealthCheckBuilder
- func (m *MachineHealthCheckBuilder) WithSelector(selector metav1.LabelSelector) *MachineHealthCheckBuilder
- func (m *MachineHealthCheckBuilder) WithUnhealthyConditions(conditions []clusterv1.UnhealthyCondition) *MachineHealthCheckBuilder
- type MachineSetBuilder
- func (m *MachineSetBuilder) Build() *clusterv1.MachineSet
- func (m *MachineSetBuilder) WithBootstrapTemplate(ref *unstructured.Unstructured) *MachineSetBuilder
- func (m *MachineSetBuilder) WithInfrastructureTemplate(ref *unstructured.Unstructured) *MachineSetBuilder
- func (m *MachineSetBuilder) WithLabels(labels map[string]string) *MachineSetBuilder
- func (m *MachineSetBuilder) WithReplicas(replicas *int32) *MachineSetBuilder
Constants ¶
This section is empty.
Variables ¶
var ( // BootstrapGroupVersion is group version used for bootstrap objects. BootstrapGroupVersion = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta1"} // GenericBootstrapConfigKind is the Kind for the GenericBootstrapConfig. GenericBootstrapConfigKind = "GenericBootstrapConfig" // GenericBootstrapConfigCRD is a generic boostrap CRD. GenericBootstrapConfigCRD = generateCRD(BootstrapGroupVersion.WithKind(GenericBootstrapConfigKind)) // GenericBootstrapConfigTemplateKind is the Kind for the GenericBoostrapConfigTemplate. GenericBootstrapConfigTemplateKind = "GenericBootstrapConfigTemplate" // GenericBootstrapConfigTemplateCRD is a generic boostrap template CRD. GenericBootstrapConfigTemplateCRD = generateCRD(BootstrapGroupVersion.WithKind(GenericBootstrapConfigTemplateKind)) )
var ( // ControlPlaneGroupVersion is group version used for control plane objects. ControlPlaneGroupVersion = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta1"} // GenericControlPlaneKind is the Kind for the GenericControlPlane. GenericControlPlaneKind = "GenericControlPlane" // GenericControlPlaneCRD is a generic control plane CRD. GenericControlPlaneCRD = generateCRD(ControlPlaneGroupVersion.WithKind(GenericControlPlaneKind)) // GenericControlPlaneTemplateKind is the Kind for the GenericControlPlaneTemplate. GenericControlPlaneTemplateKind = "GenericControlPlaneTemplate" // GenericControlPlaneTemplateCRD is a generic control plane template CRD. GenericControlPlaneTemplateCRD = generateCRD(ControlPlaneGroupVersion.WithKind(GenericControlPlaneTemplateKind)) )
var ( // InfrastructureGroupVersion is group version used for infrastructure objects. InfrastructureGroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"} // GenericInfrastructureMachineKind is the Kind for the GenericInfrastructureMachine. GenericInfrastructureMachineKind = "GenericInfrastructureMachine" // GenericInfrastructureMachineCRD is a generic infrastructure machine CRD. GenericInfrastructureMachineCRD = generateCRD(InfrastructureGroupVersion.WithKind(GenericInfrastructureMachineKind)) // GenericInfrastructureMachineTemplateKind is the Kind for the GenericInfrastructureMachineTemplate. GenericInfrastructureMachineTemplateKind = "GenericInfrastructureMachineTemplate" // GenericInfrastructureMachineTemplateCRD is a generic infrastructure machine template CRD. GenericInfrastructureMachineTemplateCRD = generateCRD(InfrastructureGroupVersion.WithKind(GenericInfrastructureMachineTemplateKind)) // GenericInfrastructureClusterKind is the kind for the GenericInfrastructureCluster type. GenericInfrastructureClusterKind = "GenericInfrastructureCluster" // GenericInfrastructureClusterCRD is a generic infrastructure machine CRD. GenericInfrastructureClusterCRD = generateCRD(InfrastructureGroupVersion.WithKind(GenericInfrastructureClusterKind)) // GenericInfrastructureClusterTemplateKind is the kind for the GenericInfrastructureClusterTemplate type. GenericInfrastructureClusterTemplateKind = "GenericInfrastructureClusterTemplate" // GenericInfrastructureClusterTemplateCRD is a generic infrastructure machine template CRD. GenericInfrastructureClusterTemplateCRD = generateCRD(InfrastructureGroupVersion.WithKind(GenericInfrastructureClusterTemplateKind)) )
var ( // RemediationGroupVersion is group version used for remediation objects. RemediationGroupVersion = schema.GroupVersion{Group: "remediation.external.io", Version: "v1beta1"} // GenericRemediationCRD is a generic infrastructure remediation CRD. GenericRemediationCRD = generateCRD(RemediationGroupVersion.WithKind("GenericExternalRemediation")) // GenericRemediationTemplateCRD is a generic infrastructure remediation template CRD. GenericRemediationTemplateCRD = generateCRD(RemediationGroupVersion.WithKind("GenericExternalRemediationTemplate")) )
Functions ¶
This section is empty.
Types ¶
type BootstrapTemplateBuilder ¶
type BootstrapTemplateBuilder struct {
// contains filtered or unexported fields
}
BootstrapTemplateBuilder holds the variables needed to build a generic BootstrapTemplate.
func BootstrapTemplate ¶
func BootstrapTemplate(namespace, name string) *BootstrapTemplateBuilder
BootstrapTemplate creates a BootstrapTemplateBuilder with the given name and namespace.
func (*BootstrapTemplateBuilder) Build ¶
func (b *BootstrapTemplateBuilder) Build() *unstructured.Unstructured
Build creates a new Unstructured object with the information passed to the BootstrapTemplateBuilder.
func (*BootstrapTemplateBuilder) WithSpecFields ¶
func (b *BootstrapTemplateBuilder) WithSpecFields(fields map[string]interface{}) *BootstrapTemplateBuilder
WithSpecFields will add fields of any type to the object spec. It takes an argument, fields, which is of the form path: object.
type ClusterBuilder ¶
type ClusterBuilder struct {
// contains filtered or unexported fields
}
ClusterBuilder holds the variables and objects required to build a clusterv1.Cluster.
func Cluster ¶
func Cluster(namespace, name string) *ClusterBuilder
Cluster returns a ClusterBuilder with the given name and namespace.
func (*ClusterBuilder) Build ¶
func (c *ClusterBuilder) Build() *clusterv1.Cluster
Build returns a Cluster with the attributes added to the ClusterBuilder.
func (*ClusterBuilder) WithControlPlane ¶
func (c *ClusterBuilder) WithControlPlane(t *unstructured.Unstructured) *ClusterBuilder
WithControlPlane adds the passed ControlPlane to the ClusterBuilder.
func (*ClusterBuilder) WithInfrastructureCluster ¶
func (c *ClusterBuilder) WithInfrastructureCluster(t *unstructured.Unstructured) *ClusterBuilder
WithInfrastructureCluster adds the passed InfrastructureCluster to the ClusterBuilder.
func (*ClusterBuilder) WithLabels ¶
func (c *ClusterBuilder) WithLabels(labels map[string]string) *ClusterBuilder
WithLabels sets the labels for the ClusterBuilder.
func (*ClusterBuilder) WithTopology ¶
func (c *ClusterBuilder) WithTopology(topology *clusterv1.Topology) *ClusterBuilder
WithTopology adds the passed Topology object to the ClusterBuilder.
type ClusterClassBuilder ¶
type ClusterClassBuilder struct {
// contains filtered or unexported fields
}
ClusterClassBuilder holds the variables and objects required to build a clusterv1.ClusterClass.
func ClusterClass ¶
func ClusterClass(namespace, name string) *ClusterClassBuilder
ClusterClass returns a ClusterClassBuilder with the given name and namespace.
func (*ClusterClassBuilder) Build ¶
func (c *ClusterClassBuilder) Build() *clusterv1.ClusterClass
Build takes the objects and variables in the ClusterClass builder and uses them to create a ClusterClass object.
func (*ClusterClassBuilder) WithControlPlaneInfrastructureMachineTemplate ¶
func (c *ClusterClassBuilder) WithControlPlaneInfrastructureMachineTemplate(t *unstructured.Unstructured) *ClusterClassBuilder
WithControlPlaneInfrastructureMachineTemplate adds the ControlPlane's InfrastructureMachineTemplate to the ClusterClassBuilder.
func (*ClusterClassBuilder) WithControlPlaneMachineHealthCheck ¶
func (c *ClusterClassBuilder) WithControlPlaneMachineHealthCheck(mhc *clusterv1.MachineHealthCheckClass) *ClusterClassBuilder
WithControlPlaneMachineHealthCheck adds a MachineHealthCheck for the ControlPlane to the ClusterClassBuilder.
func (*ClusterClassBuilder) WithControlPlaneMetadata ¶
func (c *ClusterClassBuilder) WithControlPlaneMetadata(labels, annotations map[string]string) *ClusterClassBuilder
WithControlPlaneMetadata adds the given labels and annotations for use with the ControlPlane to the ClusterClassBuilder.
func (*ClusterClassBuilder) WithControlPlaneTemplate ¶
func (c *ClusterClassBuilder) WithControlPlaneTemplate(t *unstructured.Unstructured) *ClusterClassBuilder
WithControlPlaneTemplate adds the passed ControlPlaneTemplate to the ClusterClassBuilder.
func (*ClusterClassBuilder) WithInfrastructureClusterTemplate ¶
func (c *ClusterClassBuilder) WithInfrastructureClusterTemplate(t *unstructured.Unstructured) *ClusterClassBuilder
WithInfrastructureClusterTemplate adds the passed InfrastructureClusterTemplate to the ClusterClassBuilder.
func (*ClusterClassBuilder) WithPatches ¶
func (c *ClusterClassBuilder) WithPatches(patches []clusterv1.ClusterClassPatch) *ClusterClassBuilder
WithPatches adds the patches to the ClusterClassBuilder.
func (*ClusterClassBuilder) WithVariables ¶
func (c *ClusterClassBuilder) WithVariables(vars ...clusterv1.ClusterClassVariable) *ClusterClassBuilder
WithVariables adds the Variables the ClusterClassBuilder.
func (*ClusterClassBuilder) WithWorkerMachineDeploymentClasses ¶
func (c *ClusterClassBuilder) WithWorkerMachineDeploymentClasses(mdcs ...clusterv1.MachineDeploymentClass) *ClusterClassBuilder
WithWorkerMachineDeploymentClasses adds the variables and objects needed to create MachineDeploymentTemplates for a ClusterClassBuilder.
type ClusterTopologyBuilder ¶
type ClusterTopologyBuilder struct {
// contains filtered or unexported fields
}
ClusterTopologyBuilder contains the fields needed to build a testable ClusterTopology.
func ClusterTopology ¶
func ClusterTopology() *ClusterTopologyBuilder
ClusterTopology returns a ClusterTopologyBuilder.
func (*ClusterTopologyBuilder) Build ¶
func (c *ClusterTopologyBuilder) Build() *clusterv1.Topology
Build returns a testable cluster Topology object with any values passed to the builder.
func (*ClusterTopologyBuilder) WithClass ¶
func (c *ClusterTopologyBuilder) WithClass(class string) *ClusterTopologyBuilder
WithClass adds the passed ClusterClass name to the ClusterTopologyBuilder.
func (*ClusterTopologyBuilder) WithControlPlaneReplicas ¶
func (c *ClusterTopologyBuilder) WithControlPlaneReplicas(replicas int32) *ClusterTopologyBuilder
WithControlPlaneReplicas adds the passed replicas value to the ClusterTopologyBuilder.
func (*ClusterTopologyBuilder) WithMachineDeployment ¶
func (c *ClusterTopologyBuilder) WithMachineDeployment(mdc clusterv1.MachineDeploymentTopology) *ClusterTopologyBuilder
WithMachineDeployment passes the full MachineDeploymentTopology and adds it to an existing list in the ClusterTopologyBuilder.
func (*ClusterTopologyBuilder) WithVariables ¶
func (c *ClusterTopologyBuilder) WithVariables(vars ...clusterv1.ClusterVariable) *ClusterTopologyBuilder
WithVariables adds the passed variables to the ClusterTopologyBuilder.
func (*ClusterTopologyBuilder) WithVersion ¶
func (c *ClusterTopologyBuilder) WithVersion(version string) *ClusterTopologyBuilder
WithVersion adds the passed version to the ClusterTopologyBuilder.
type ControlPlaneBuilder ¶
type ControlPlaneBuilder struct {
// contains filtered or unexported fields
}
ControlPlaneBuilder holds the variables and objects needed to build a generic object for cluster.spec.controlPlaneRef.
func ControlPlane ¶
func ControlPlane(namespace, name string) *ControlPlaneBuilder
ControlPlane returns a ControlPlaneBuilder with the given name and Namespace.
func (*ControlPlaneBuilder) Build ¶
func (f *ControlPlaneBuilder) Build() *unstructured.Unstructured
Build generates an Unstructured object from the information passed to the ControlPlaneBuilder.
func (*ControlPlaneBuilder) WithInfrastructureMachineTemplate ¶
func (f *ControlPlaneBuilder) WithInfrastructureMachineTemplate(t *unstructured.Unstructured) *ControlPlaneBuilder
WithInfrastructureMachineTemplate adds the given unstructured object to the ControlPlaneBuilder as its InfrastructureMachineTemplate.
func (*ControlPlaneBuilder) WithReplicas ¶
func (f *ControlPlaneBuilder) WithReplicas(replicas int64) *ControlPlaneBuilder
WithReplicas sets the number of replicas for the ControlPlaneBuilder.
func (*ControlPlaneBuilder) WithSpecFields ¶
func (f *ControlPlaneBuilder) WithSpecFields(m map[string]interface{}) *ControlPlaneBuilder
WithSpecFields sets a map of spec fields on the unstructured object. The keys in the map represent the path and the value corresponds to the value of the spec field.
Note: all the paths should start with "spec."
Example map: map[string]interface{}{ "spec.version": "v1.2.3", }.
func (*ControlPlaneBuilder) WithStatusFields ¶
func (f *ControlPlaneBuilder) WithStatusFields(m map[string]interface{}) *ControlPlaneBuilder
WithStatusFields sets a map of status fields on the unstructured object. The keys in the map represent the path and the value corresponds to the value of the status field.
Note: all the paths should start with "status."
Example map: map[string]interface{}{ "status.version": "v1.2.3", }.
func (*ControlPlaneBuilder) WithVersion ¶
func (f *ControlPlaneBuilder) WithVersion(version string) *ControlPlaneBuilder
WithVersion adds the passed version to the ControlPlaneBuilder.
type ControlPlaneTemplateBuilder ¶
type ControlPlaneTemplateBuilder struct {
// contains filtered or unexported fields
}
ControlPlaneTemplateBuilder holds the variables and objects needed to build a generic ControlPlane template.
func ControlPlaneTemplate ¶
func ControlPlaneTemplate(namespace, name string) *ControlPlaneTemplateBuilder
ControlPlaneTemplate creates a NewControlPlaneTemplate builder with the given name and namespace.
func (*ControlPlaneTemplateBuilder) Build ¶
func (c *ControlPlaneTemplateBuilder) Build() *unstructured.Unstructured
Build creates an Unstructured object from the variables passed to the ControlPlaneTemplateBuilder.
func (*ControlPlaneTemplateBuilder) WithInfrastructureMachineTemplate ¶
func (c *ControlPlaneTemplateBuilder) WithInfrastructureMachineTemplate(t *unstructured.Unstructured) *ControlPlaneTemplateBuilder
WithInfrastructureMachineTemplate adds the given Unstructured object to the ControlPlaneTemplateBuilder as its InfrastructureMachineTemplate.
func (*ControlPlaneTemplateBuilder) WithSpecFields ¶
func (c *ControlPlaneTemplateBuilder) WithSpecFields(fields map[string]interface{}) *ControlPlaneTemplateBuilder
WithSpecFields sets a map of spec fields on the unstructured object. The keys in the map represent the path and the value corresponds to the value of the spec field.
Note: all the paths should start with "spec."
Example map: map[string]interface{}{ "spec.version": "v1.2.3", }.
type InfrastructureClusterBuilder ¶
type InfrastructureClusterBuilder struct {
// contains filtered or unexported fields
}
InfrastructureClusterBuilder holds the variables and objects needed to build a generic InfrastructureCluster.
func InfrastructureCluster ¶
func InfrastructureCluster(namespace, name string) *InfrastructureClusterBuilder
InfrastructureCluster returns and InfrastructureClusterBuilder with the given name and namespace.
func (*InfrastructureClusterBuilder) Build ¶
func (i *InfrastructureClusterBuilder) Build() *unstructured.Unstructured
Build returns an Unstructured object with the information passed to the InfrastructureClusterBuilder.
func (*InfrastructureClusterBuilder) WithSpecFields ¶
func (i *InfrastructureClusterBuilder) WithSpecFields(fields map[string]interface{}) *InfrastructureClusterBuilder
WithSpecFields sets a map of spec fields on the unstructured object. The keys in the map represent the path and the value corresponds to the value of the spec field.
Note: all the paths should start with "spec."
Example map: map[string]interface{}{ "spec.version": "v1.2.3", }.
type InfrastructureClusterTemplateBuilder ¶
type InfrastructureClusterTemplateBuilder struct {
// contains filtered or unexported fields
}
InfrastructureClusterTemplateBuilder holds the variables needed to build a generic InfrastructureClusterTemplate.
func InfrastructureClusterTemplate ¶
func InfrastructureClusterTemplate(namespace, name string) *InfrastructureClusterTemplateBuilder
InfrastructureClusterTemplate returns an InfrastructureClusterTemplateBuilder with the given name and namespace.
func (*InfrastructureClusterTemplateBuilder) Build ¶
func (i *InfrastructureClusterTemplateBuilder) Build() *unstructured.Unstructured
Build creates a new Unstructured object with the variables passed to the InfrastructureClusterTemplateBuilder.
func (*InfrastructureClusterTemplateBuilder) WithSpecFields ¶
func (i *InfrastructureClusterTemplateBuilder) WithSpecFields(fields map[string]interface{}) *InfrastructureClusterTemplateBuilder
WithSpecFields sets a map of spec fields on the unstructured object. The keys in the map represent the path and the value corresponds to the value of the spec field.
Note: all the paths should start with "spec."
Example map: map[string]interface{}{ "spec.version": "v1.2.3", }.
type InfrastructureMachineTemplateBuilder ¶
type InfrastructureMachineTemplateBuilder struct {
// contains filtered or unexported fields
}
InfrastructureMachineTemplateBuilder holds the variables and objects needed to build an InfrastructureMachineTemplate.
func InfrastructureMachineTemplate ¶
func InfrastructureMachineTemplate(namespace, name string) *InfrastructureMachineTemplateBuilder
InfrastructureMachineTemplate creates an InfrastructureMachineTemplateBuilder with the given name and namespace.
func (*InfrastructureMachineTemplateBuilder) Build ¶
func (i *InfrastructureMachineTemplateBuilder) Build() *unstructured.Unstructured
Build takes the objects and variables in the InfrastructureMachineTemplateBuilder and generates an unstructured object.
func (*InfrastructureMachineTemplateBuilder) WithSpecFields ¶
func (i *InfrastructureMachineTemplateBuilder) WithSpecFields(fields map[string]interface{}) *InfrastructureMachineTemplateBuilder
WithSpecFields sets a map of spec fields on the unstructured object. The keys in the map represent the path and the value corresponds to the value of the spec field.
Note: all the paths should start with "spec."
Example map: map[string]interface{}{ "spec.version": "v1.2.3", }.
type MachineDeploymentBuilder ¶
type MachineDeploymentBuilder struct {
// contains filtered or unexported fields
}
MachineDeploymentBuilder holds the variables and objects needed to build a generic MachineDeployment.
func MachineDeployment ¶
func MachineDeployment(namespace, name string) *MachineDeploymentBuilder
MachineDeployment creates a MachineDeploymentBuilder with the given name and namespace.
func (*MachineDeploymentBuilder) Build ¶
func (m *MachineDeploymentBuilder) Build() *clusterv1.MachineDeployment
Build creates a new MachineDeployment with the variables and objects passed to the MachineDeploymentBuilder.
func (*MachineDeploymentBuilder) WithBootstrapTemplate ¶
func (m *MachineDeploymentBuilder) WithBootstrapTemplate(ref *unstructured.Unstructured) *MachineDeploymentBuilder
WithBootstrapTemplate adds the passed Unstructured object to the MachineDeploymentBuilder as a bootstrapTemplate.
func (*MachineDeploymentBuilder) WithGeneration ¶
func (m *MachineDeploymentBuilder) WithGeneration(generation int64) *MachineDeploymentBuilder
WithGeneration sets the passed value on the machine deployments object metadata.
func (*MachineDeploymentBuilder) WithInfrastructureTemplate ¶
func (m *MachineDeploymentBuilder) WithInfrastructureTemplate(ref *unstructured.Unstructured) *MachineDeploymentBuilder
WithInfrastructureTemplate adds the passed unstructured object to the MachineDeployment builder as an infrastructureMachineTemplate.
func (*MachineDeploymentBuilder) WithLabels ¶
func (m *MachineDeploymentBuilder) WithLabels(labels map[string]string) *MachineDeploymentBuilder
WithLabels adds the given labels to the MachineDeploymentBuilder.
func (*MachineDeploymentBuilder) WithReplicas ¶
func (m *MachineDeploymentBuilder) WithReplicas(replicas int32) *MachineDeploymentBuilder
WithReplicas sets the number of replicas for the MachineDeploymentClassBuilder.
func (*MachineDeploymentBuilder) WithStatus ¶
func (m *MachineDeploymentBuilder) WithStatus(status clusterv1.MachineDeploymentStatus) *MachineDeploymentBuilder
WithStatus sets the passed status object as the status of the machine deployment object.
func (*MachineDeploymentBuilder) WithVersion ¶
func (m *MachineDeploymentBuilder) WithVersion(version string) *MachineDeploymentBuilder
WithVersion sets the passed version on the machine deployment spec.
type MachineDeploymentClassBuilder ¶
type MachineDeploymentClassBuilder struct {
// contains filtered or unexported fields
}
MachineDeploymentClassBuilder holds the variables and objects required to build a clusterv1.MachineDeploymentClass.
func MachineDeploymentClass ¶
func MachineDeploymentClass(class string) *MachineDeploymentClassBuilder
MachineDeploymentClass returns a MachineDeploymentClassBuilder with the given name and namespace.
func (*MachineDeploymentClassBuilder) Build ¶
func (m *MachineDeploymentClassBuilder) Build() *clusterv1.MachineDeploymentClass
Build creates a full MachineDeploymentClass object with the variables passed to the MachineDeploymentClassBuilder.
func (*MachineDeploymentClassBuilder) WithAnnotations ¶
func (m *MachineDeploymentClassBuilder) WithAnnotations(annotations map[string]string) *MachineDeploymentClassBuilder
WithAnnotations sets the annotations for the MachineDeploymentClassBuilder.
func (*MachineDeploymentClassBuilder) WithBootstrapTemplate ¶
func (m *MachineDeploymentClassBuilder) WithBootstrapTemplate(t *unstructured.Unstructured) *MachineDeploymentClassBuilder
WithBootstrapTemplate registers the passed Unstructured object as the BootstrapTemplate for the MachineDeploymentClassBuilder.
func (*MachineDeploymentClassBuilder) WithInfrastructureTemplate ¶
func (m *MachineDeploymentClassBuilder) WithInfrastructureTemplate(t *unstructured.Unstructured) *MachineDeploymentClassBuilder
WithInfrastructureTemplate registers the passed Unstructured object as the InfrastructureMachineTemplate for the MachineDeploymentClassBuilder.
func (*MachineDeploymentClassBuilder) WithLabels ¶
func (m *MachineDeploymentClassBuilder) WithLabels(labels map[string]string) *MachineDeploymentClassBuilder
WithLabels sets the labels for the MachineDeploymentClassBuilder.
func (*MachineDeploymentClassBuilder) WithMachineHealthCheckClass ¶
func (m *MachineDeploymentClassBuilder) WithMachineHealthCheckClass(mhc *clusterv1.MachineHealthCheckClass) *MachineDeploymentClassBuilder
WithMachineHealthCheckClass sets the MachineHealthCheckClass for the MachineDeploymentClassBuilder.
type MachineDeploymentTopologyBuilder ¶
type MachineDeploymentTopologyBuilder struct {
// contains filtered or unexported fields
}
MachineDeploymentTopologyBuilder holds the values needed to create a testable MachineDeploymentTopology.
func MachineDeploymentTopology ¶
func MachineDeploymentTopology(name string) *MachineDeploymentTopologyBuilder
MachineDeploymentTopology returns a builder used to create a testable MachineDeploymentTopology.
func (*MachineDeploymentTopologyBuilder) Build ¶
func (m *MachineDeploymentTopologyBuilder) Build() clusterv1.MachineDeploymentTopology
Build returns a testable MachineDeploymentTopology with any values passed to the builder.
func (*MachineDeploymentTopologyBuilder) WithClass ¶
func (m *MachineDeploymentTopologyBuilder) WithClass(class string) *MachineDeploymentTopologyBuilder
WithClass adds a class string used as the MachineDeploymentTopology class.
func (*MachineDeploymentTopologyBuilder) WithReplicas ¶
func (m *MachineDeploymentTopologyBuilder) WithReplicas(replicas int32) *MachineDeploymentTopologyBuilder
WithReplicas adds a replicas value used as the MachineDeploymentTopology replicas value.
func (*MachineDeploymentTopologyBuilder) WithVariables ¶
func (m *MachineDeploymentTopologyBuilder) WithVariables(variables ...clusterv1.ClusterVariable) *MachineDeploymentTopologyBuilder
WithVariables adds variables used as the MachineDeploymentTopology variables value.
type MachineHealthCheckBuilder ¶
type MachineHealthCheckBuilder struct {
// contains filtered or unexported fields
}
MachineHealthCheckBuilder holds fields for creating a MachineHealthCheck.
func MachineHealthCheck ¶
func MachineHealthCheck(namespace, name string) *MachineHealthCheckBuilder
MachineHealthCheck returns a MachineHealthCheckBuilder with the given name and namespace.
func (*MachineHealthCheckBuilder) Build ¶
func (m *MachineHealthCheckBuilder) Build() *clusterv1.MachineHealthCheck
Build returns a MachineHealthCheck with the supplied details.
func (*MachineHealthCheckBuilder) WithClusterName ¶
func (m *MachineHealthCheckBuilder) WithClusterName(clusterName string) *MachineHealthCheckBuilder
WithClusterName adds a cluster name for the MachineHealthCheck.
func (*MachineHealthCheckBuilder) WithMaxUnhealthy ¶
func (m *MachineHealthCheckBuilder) WithMaxUnhealthy(maxUnhealthy *intstr.IntOrString) *MachineHealthCheckBuilder
WithMaxUnhealthy adds a MaxUnhealthyValue for the MachineHealthCheck.
func (*MachineHealthCheckBuilder) WithOwnerReferences ¶
func (m *MachineHealthCheckBuilder) WithOwnerReferences(ownerRefs []metav1.OwnerReference) *MachineHealthCheckBuilder
WithOwnerReferences adds ownerreferences for the MachineHealthCheck.
func (*MachineHealthCheckBuilder) WithSelector ¶
func (m *MachineHealthCheckBuilder) WithSelector(selector metav1.LabelSelector) *MachineHealthCheckBuilder
WithSelector adds the selector used to target machines for the MachineHealthCheck.
func (*MachineHealthCheckBuilder) WithUnhealthyConditions ¶
func (m *MachineHealthCheckBuilder) WithUnhealthyConditions(conditions []clusterv1.UnhealthyCondition) *MachineHealthCheckBuilder
WithUnhealthyConditions adds the spec used to build the parameters of the MachineHealthCheck.
type MachineSetBuilder ¶
type MachineSetBuilder struct {
// contains filtered or unexported fields
}
MachineSetBuilder holds the variables and objects needed to build a generic MachineSet.
func MachineSet ¶
func MachineSet(namespace, name string) *MachineSetBuilder
MachineSet creates a MachineSetBuilder with the given name and namespace.
func (*MachineSetBuilder) Build ¶
func (m *MachineSetBuilder) Build() *clusterv1.MachineSet
Build creates a new MachineSet with the variables and objects passed to the MachineSetBuilder.
func (*MachineSetBuilder) WithBootstrapTemplate ¶
func (m *MachineSetBuilder) WithBootstrapTemplate(ref *unstructured.Unstructured) *MachineSetBuilder
WithBootstrapTemplate adds the passed Unstructured object to the MachineSetBuilder as a bootstrapTemplate.
func (*MachineSetBuilder) WithInfrastructureTemplate ¶
func (m *MachineSetBuilder) WithInfrastructureTemplate(ref *unstructured.Unstructured) *MachineSetBuilder
WithInfrastructureTemplate adds the passed unstructured object to the MachineSet builder as an infrastructureMachineTemplate.
func (*MachineSetBuilder) WithLabels ¶
func (m *MachineSetBuilder) WithLabels(labels map[string]string) *MachineSetBuilder
WithLabels adds the given labels to the MachineSetBuilder.
func (*MachineSetBuilder) WithReplicas ¶
func (m *MachineSetBuilder) WithReplicas(replicas *int32) *MachineSetBuilder
WithReplicas sets the number of replicas for the MachineSetClassBuilder.