Skip to content

Commit

Permalink
Fix inconsistency by updating constant 'ClusterLabelName' to 'Cluster…
Browse files Browse the repository at this point in the history
…NameLabel' arised post resolve conflicts

Signed-off-by: Chirayu Kapoor <dev.csociety@gmail.com>
  • Loading branch information
chiukapoor committed Nov 28, 2022
1 parent 08b7635 commit f9903f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controlplane/kubeadm/internal/controllers/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ func TestKubeadmControlPlaneReconciler_generateMachine(t *testing.T) {
for k, v := range kcpMachineTemplateObjectMeta.Labels {
g.Expect(machine.Labels[k]).To(Equal(v))
}
g.Expect(machine.Labels[clusterv1.ClusterLabelName]).To(Equal(cluster.Name))
g.Expect(machine.Labels[clusterv1.ClusterNameLabel]).To(Equal(cluster.Name))
g.Expect(machine.Labels[clusterv1.MachineControlPlaneLabelName]).To(Equal(""))
g.Expect(machine.Labels[clusterv1.MachineControlPlaneNameLabel]).To(Equal(kcp.Name))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func TestMachineDeploymentReconciler(t *testing.T) {
g.Expect(*firstMachineSet.Spec.Replicas).To(BeEquivalentTo(2))
g.Expect(*firstMachineSet.Spec.Template.Spec.Version).To(BeEquivalentTo("v1.10.3"))

t.Log("Verify MachineSet has expected ClusterLabelName and MachineDeploymentLabelName")
g.Expect(firstMachineSet.Labels[clusterv1.ClusterLabelName]).To(Equal(testCluster.Name))
t.Log("Verify MachineSet has expected ClusterNameLabel and MachineDeploymentLabelName")
g.Expect(firstMachineSet.Labels[clusterv1.ClusterNameLabel]).To(Equal(testCluster.Name))
g.Expect(firstMachineSet.Labels[clusterv1.MachineDeploymentLabelName]).To(Equal(deployment.Name))

t.Log("Verify expected number of Machines are created")
Expand All @@ -221,7 +221,7 @@ func TestMachineDeploymentReconciler(t *testing.T) {
return len(machines.Items)
}, timeout).Should(BeEquivalentTo(*deployment.Spec.Replicas))

t.Log("Verify Machines have expected ClusterLabelName, MachineDeploymentLabelName and MachineSetLabelName")
t.Log("Verify Machines have expected ClusterNameLabel, MachineDeploymentLabelName and MachineSetLabelName")
for _, m := range machines.Items {
g.Expect(m.Labels[clusterv1.ClusterNameLabel]).To(Equal(testCluster.Name))
g.Expect(m.Labels[clusterv1.MachineDeploymentLabelName]).To(Equal(deployment.Name))
Expand Down

0 comments on commit f9903f8

Please sign in to comment.