Skip to content

Commit c287a17

Browse files
committed
e2e: do taints in-place tests before doing rollout change
1 parent b1cbf65 commit c287a17

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

test/e2e/md_rollout.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ func MachineDeploymentRolloutSpec(ctx context.Context, inputGetter func() Machin
109109
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
110110
}, clusterResources)
111111

112+
// Get all machines before doing in-place changes so we can check at the end that no machines were replaced.
113+
machinesBeforeInPlaceChanges := getMachinesByCluster(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster)
114+
112115
By("Upgrade MachineDeployment in-place mutable fields and wait for in-place propagation")
113116
framework.UpgradeMachineDeploymentInPlaceMutableFieldsAndWait(ctx, framework.UpgradeMachineDeploymentInPlaceMutableFieldsAndWaitInput{
114117
ClusterProxy: input.BootstrapClusterProxy,
@@ -117,31 +120,6 @@ func MachineDeploymentRolloutSpec(ctx context.Context, inputGetter func() Machin
117120
MachineDeployments: clusterResources.MachineDeployments,
118121
})
119122

120-
By("Upgrading MachineDeployment Infrastructure ref and wait for rolling upgrade")
121-
framework.UpgradeMachineDeploymentInfrastructureRefAndWait(ctx, framework.UpgradeMachineDeploymentInfrastructureRefAndWaitInput{
122-
ClusterProxy: input.BootstrapClusterProxy,
123-
Cluster: clusterResources.Cluster,
124-
WaitForMachinesToBeUpgraded: input.E2EConfig.GetIntervals(specName, "wait-machine-upgrade"),
125-
MachineDeployments: clusterResources.MachineDeployments,
126-
})
127-
128-
Byf("Verify Cluster Available condition is true")
129-
framework.VerifyClusterAvailable(ctx, framework.VerifyClusterAvailableInput{
130-
Getter: input.BootstrapClusterProxy.GetClient(),
131-
Name: clusterResources.Cluster.Name,
132-
Namespace: clusterResources.Cluster.Namespace,
133-
})
134-
135-
Byf("Verify Machines Ready condition is true")
136-
framework.VerifyMachinesReady(ctx, framework.VerifyMachinesReadyInput{
137-
Lister: input.BootstrapClusterProxy.GetClient(),
138-
Name: clusterResources.Cluster.Name,
139-
Namespace: clusterResources.Cluster.Namespace,
140-
})
141-
142-
// Get all machines before doing in-place changes so we can check at the end that no machines were replaced.
143-
machinesBeforeInPlaceChanges := getMachinesByCluster(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster)
144-
145123
preExistingAlwaysTaint := clusterv1.MachineTaint{
146124
Key: "pre-existing-always-taint",
147125
Value: "always-value",
@@ -280,6 +258,28 @@ func MachineDeploymentRolloutSpec(ctx context.Context, inputGetter func() Machin
280258
g.Expect(machinesAfterInPlaceChanges).To(BeComparableTo(machinesBeforeInPlaceChanges), "Machines must not be replaced through in-place rollout")
281259
}, 30*time.Second, 1*time.Second).Should(Succeed())
282260

261+
By("Upgrading MachineDeployment Infrastructure ref and wait for rolling upgrade")
262+
framework.UpgradeMachineDeploymentInfrastructureRefAndWait(ctx, framework.UpgradeMachineDeploymentInfrastructureRefAndWaitInput{
263+
ClusterProxy: input.BootstrapClusterProxy,
264+
Cluster: clusterResources.Cluster,
265+
WaitForMachinesToBeUpgraded: input.E2EConfig.GetIntervals(specName, "wait-machine-upgrade"),
266+
MachineDeployments: clusterResources.MachineDeployments,
267+
})
268+
269+
Byf("Verify Cluster Available condition is true")
270+
framework.VerifyClusterAvailable(ctx, framework.VerifyClusterAvailableInput{
271+
Getter: input.BootstrapClusterProxy.GetClient(),
272+
Name: clusterResources.Cluster.Name,
273+
Namespace: clusterResources.Cluster.Namespace,
274+
})
275+
276+
Byf("Verify Machines Ready condition is true")
277+
framework.VerifyMachinesReady(ctx, framework.VerifyMachinesReadyInput{
278+
Lister: input.BootstrapClusterProxy.GetClient(),
279+
Name: clusterResources.Cluster.Name,
280+
Namespace: clusterResources.Cluster.Namespace,
281+
})
282+
283283
By("PASSED!")
284284
})
285285

0 commit comments

Comments
 (0)