Skip to content

Commit

Permalink
Fix rebase errors
Browse files Browse the repository at this point in the history
  • Loading branch information
willie-yao committed Sep 5, 2023
1 parent 6b68d1c commit c91fcd7
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions internal/controllers/topology/cluster/current_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ func TestGetCurrentState(t *testing.T) {
clusterv1.ClusterTopologyOwnedLabel: "",
clusterv1.ClusterTopologyMachinePoolNameLabel: "mp1",
}).
WithBootstrapTemplate(machinePoolBootstrap).
WithInfrastructureTemplate(machinePoolInfrastructure).
WithBootstrap(machinePoolBootstrap).
WithInfrastructure(machinePoolInfrastructure).
Build()
machinePool2 := builder.MachinePool(metav1.NamespaceDefault, "mp2").
WithLabels(map[string]string{
clusterv1.ClusterNameLabel: "cluster1",
clusterv1.ClusterTopologyOwnedLabel: "",
clusterv1.ClusterTopologyMachinePoolNameLabel: "mp2",
}).
WithBootstrapTemplate(machinePoolBootstrap).
WithInfrastructureTemplate(machinePoolInfrastructure).
WithBootstrap(machinePoolBootstrap).
WithInfrastructure(machinePoolInfrastructure).
Build()

tests := []struct {
Expand Down Expand Up @@ -524,17 +524,17 @@ func TestGetCurrentState(t *testing.T) {
clusterv1.ClusterNameLabel: "cluster1",
// topology.cluster.x-k8s.io/owned label is missing (unmanaged)!
}).
WithBootstrapTemplate(machinePoolBootstrap).
WithInfrastructureTemplate(machinePoolInfrastructure).
WithBootstrap(machinePoolBootstrap).
WithInfrastructure(machinePoolInfrastructure).
Build(),
builder.MachinePool(metav1.NamespaceDefault, "wrong-cluster-label").
WithLabels(map[string]string{
clusterv1.ClusterNameLabel: "another-cluster",
clusterv1.ClusterTopologyOwnedLabel: "",
clusterv1.ClusterTopologyMachinePoolNameLabel: "mp1",
}).
WithBootstrapTemplate(machinePoolBootstrap).
WithInfrastructureTemplate(machinePoolInfrastructure).
WithBootstrap(machinePoolBootstrap).
WithInfrastructure(machinePoolInfrastructure).
Build(),
},
// Expect valid return with empty MachineDeployments and MachinePools properly filtered by label.
Expand Down Expand Up @@ -611,8 +611,8 @@ func TestGetCurrentState(t *testing.T) {
clusterv1.ClusterTopologyOwnedLabel: "",
// topology.cluster.x-k8s.io/pool-name label is missing!
}).
WithBootstrapTemplate(machinePoolBootstrap).
WithInfrastructureTemplate(machinePoolInfrastructure).
WithBootstrap(machinePoolBootstrap).
WithInfrastructure(machinePoolInfrastructure).
Build(),
},
// Expect error to be thrown as no managed MachinePool is reconcilable unless it has a ClusterTopologyMachinePoolNameLabel.
Expand Down Expand Up @@ -642,8 +642,8 @@ func TestGetCurrentState(t *testing.T) {
machinePool,
builder.MachinePool(metav1.NamespaceDefault, "duplicate-labels").
WithLabels(machinePool.Labels). // Another machine pool with the same labels.
WithBootstrapTemplate(machinePoolBootstrap).
WithInfrastructureTemplate(machinePoolInfrastructure).
WithBootstrap(machinePoolBootstrap).
WithInfrastructure(machinePoolInfrastructure).
Build(),
},
// Expect error as two MachinePools with the same ClusterTopologyOwnedLabel should not exist for one cluster
Expand Down Expand Up @@ -897,7 +897,7 @@ func TestGetCurrentState(t *testing.T) {
builder.MachinePool(metav1.NamespaceDefault, "no-bootstrap").
WithLabels(machinePool.Labels).
// No BootstrapTemplate reference!
WithInfrastructureTemplate(machinePoolInfrastructure).
WithInfrastructure(machinePoolInfrastructure).
Build(),
},
// Expect error as Bootstrap Template not defined for MachinePools relevant to the Cluster.
Expand Down Expand Up @@ -974,7 +974,7 @@ func TestGetCurrentState(t *testing.T) {
machinePoolBootstrap,
builder.MachinePool(metav1.NamespaceDefault, "no-infra").
WithLabels(machinePool.Labels).
WithBootstrapTemplate(machinePoolBootstrap).
WithBootstrap(machinePoolBootstrap).
// No InfrastructureMachineTemplate reference!
Build(),
},
Expand Down

0 comments on commit c91fcd7

Please sign in to comment.