@@ -98,17 +98,10 @@ type ClusterClassSpec struct {
9898 // +kubebuilder:validation:MaxItems=32
9999 AvailabilityGates []ClusterAvailabilityGate `json:"availabilityGates,omitempty"`
100100
101- // infrastructure is a reference to a provider-specific template that holds
102- // the details for provisioning infrastructure specific cluster
103- // for the underlying provider.
104- // The underlying provider is responsible for the implementation
105- // of the template to an infrastructure cluster.
101+ // infrastructure is a reference to a local struct that holds the details
102+ // for provisioning the infrastructure cluster for the Cluster.
106103 // +optional
107- Infrastructure LocalObjectTemplate `json:"infrastructure,omitempty"`
108-
109- // infrastructureNamingStrategy allows changing the naming pattern used when creating the infrastructure object.
110- // +optional
111- InfrastructureNamingStrategy * InfrastructureNamingStrategy `json:"infrastructureNamingStrategy,omitempty"`
104+ Infrastructure InfrastructureClass `json:"infrastructure,omitempty"`
112105
113106 // controlPlane is a reference to a local struct that holds the details
114107 // for provisioning the Control Plane for the Cluster.
@@ -135,6 +128,16 @@ type ClusterClassSpec struct {
135128 Patches []ClusterClassPatch `json:"patches,omitempty"`
136129}
137130
131+ // InfrastructureClass defines the class for the infrastructure cluster.
132+ type InfrastructureClass struct {
133+ // LocalObjectTemplate contains the reference to a provider-specific infrastructure cluster template.
134+ LocalObjectTemplate `json:",inline"`
135+
136+ // namingStrategy allows changing the naming pattern used when creating the infrastructure cluster object.
137+ // +optional
138+ NamingStrategy * InfrastructureClassNamingStrategy `json:"namingStrategy,omitempty"`
139+ }
140+
138141// ControlPlaneClass defines the class for the control plane.
139142type ControlPlaneClass struct {
140143 // metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane
@@ -147,7 +150,7 @@ type ControlPlaneClass struct {
147150 // +optional
148151 Metadata ObjectMeta `json:"metadata,omitempty"`
149152
150- // LocalObjectTemplate contains the reference to the control plane provider .
153+ // LocalObjectTemplate contains the reference to a provider-specific control plane template .
151154 LocalObjectTemplate `json:",inline"`
152155
153156 // machineInfrastructure defines the metadata and infrastructure information
@@ -221,8 +224,8 @@ type ControlPlaneClassNamingStrategy struct {
221224 Template * string `json:"template,omitempty"`
222225}
223226
224- // InfrastructureNamingStrategy defines the naming strategy for infrastructure objects.
225- type InfrastructureNamingStrategy struct {
227+ // InfrastructureClassNamingStrategy defines the naming strategy for infrastructure objects.
228+ type InfrastructureClassNamingStrategy struct {
226229 // template defines the template to use for generating the name of the Infrastructure object.
227230 // If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`.
228231 // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will
0 commit comments