Skip to content

Commit 7bc1644

Browse files
committed
Make ClusterClass generated object names consistent
Signed-off-by: Stefan Büringer [email protected]
1 parent b820a31 commit 7bc1644

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cmd/clusterctl/client/cluster/topology_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ func Test_topologyClient_Plan(t *testing.T) {
9696
{kind: "DockerCluster", namespace: "default", namePrefix: "my-cluster-"},
9797
{kind: "DockerMachineTemplate", namespace: "default", namePrefix: "my-cluster-md-0-"},
9898
{kind: "DockerMachineTemplate", namespace: "default", namePrefix: "my-cluster-md-1-"},
99-
{kind: "DockerMachineTemplate", namespace: "default", namePrefix: "my-cluster-control-plane-"},
100-
{kind: "KubeadmConfigTemplate", namespace: "default", namePrefix: "my-cluster-md-0-bootstrap-"},
101-
{kind: "KubeadmConfigTemplate", namespace: "default", namePrefix: "my-cluster-md-1-bootstrap-"},
99+
{kind: "DockerMachineTemplate", namespace: "default", namePrefix: "my-cluster-"},
100+
{kind: "KubeadmConfigTemplate", namespace: "default", namePrefix: "my-cluster-md-0-"},
101+
{kind: "KubeadmConfigTemplate", namespace: "default", namePrefix: "my-cluster-md-1-"},
102102
{kind: "KubeadmControlPlane", namespace: "default", namePrefix: "my-cluster-"},
103103
{kind: "MachineDeployment", namespace: "default", namePrefix: "my-cluster-md-0-"},
104104
{kind: "MachineDeployment", namespace: "default", namePrefix: "my-cluster-md-1-"},
@@ -170,7 +170,7 @@ func Test_topologyClient_Plan(t *testing.T) {
170170
created: []item{
171171
// Modifying the DockerClusterTemplate will result in template rotation. A new template will be created
172172
// and used by KCP.
173-
{kind: "DockerMachineTemplate", namespace: "default", namePrefix: "my-cluster-control-plane-"},
173+
{kind: "DockerMachineTemplate", namespace: "default", namePrefix: "my-cluster-"},
174174
},
175175
reconciledCluster: &client.ObjectKey{Namespace: "default", Name: "my-cluster"},
176176
},
@@ -235,7 +235,7 @@ func Test_topologyClient_Plan(t *testing.T) {
235235
created: []item{
236236
// Modifying the DockerClusterTemplate will result in template rotation. A new template will be created
237237
// and used by KCP.
238-
{kind: "DockerMachineTemplate", namespace: "default", namePrefix: "my-cluster-control-plane-"},
238+
{kind: "DockerMachineTemplate", namespace: "default", namePrefix: "my-cluster-"},
239239
},
240240
reconciledCluster: &client.ObjectKey{Namespace: "default", Name: "my-cluster"},
241241
},

internal/controllers/topology/cluster/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ import (
2929

3030
// bootstrapTemplateNamePrefix calculates the name prefix for a BootstrapTemplate.
3131
func bootstrapTemplateNamePrefix(clusterName, machineDeploymentTopologyName string) string {
32-
return fmt.Sprintf("%s-%s-bootstrap-", clusterName, machineDeploymentTopologyName)
32+
return fmt.Sprintf("%s-%s-", clusterName, machineDeploymentTopologyName)
3333
}
3434

3535
// infrastructureMachineTemplateNamePrefix calculates the name prefix for a InfrastructureMachineTemplate.
3636
func infrastructureMachineTemplateNamePrefix(clusterName, machineDeploymentTopologyName string) string {
37-
return fmt.Sprintf("%s-%s-infra-", clusterName, machineDeploymentTopologyName)
37+
return fmt.Sprintf("%s-%s-", clusterName, machineDeploymentTopologyName)
3838
}
3939

4040
// infrastructureMachineTemplateNamePrefix calculates the name prefix for a InfrastructureMachineTemplate.
4141
func controlPlaneInfrastructureMachineTemplateNamePrefix(clusterName string) string {
42-
return fmt.Sprintf("%s-control-plane-", clusterName)
42+
return fmt.Sprintf("%s-", clusterName)
4343
}
4444

4545
// getReference gets the object referenced in ref.

0 commit comments

Comments
 (0)