Skip to content

Commit a6d34dc

Browse files
committed
fix
1 parent a2d3103 commit a6d34dc

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

test/e2e/autoscaler.go

+24-24
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ func AutoscalerSpec(ctx context.Context, inputGetter func() AutoscalerSpecInput)
244244
WaitForMachineDeployment: input.E2EConfig.GetIntervals(specName, "wait-controllers"),
245245
})
246246

247-
By("Deleting the MachineDeployment scale up deployment")
248-
framework.DeleteScaleUpDeploymentAndWait(ctx, framework.DeleteScaleUpDeploymentAndWaitInput{
249-
ClusterProxy: workloadClusterProxy,
250-
WaitForDelete: input.E2EConfig.GetIntervals(specName, "wait-autoscaler"),
251-
})
252-
253247
if input.ScaleToAndFromZero {
248+
By("Deleting the MachineDeployment scale up deployment")
249+
framework.DeleteScaleUpDeploymentAndWait(ctx, framework.DeleteScaleUpDeploymentAndWaitInput{
250+
ClusterProxy: workloadClusterProxy,
251+
WaitForDelete: input.E2EConfig.GetIntervals(specName, "wait-autoscaler"),
252+
})
253+
254254
By("Enabling autoscaler for the MachineDeployment to zero")
255255
// Enable autoscaler on the MachineDeployment.
256256
framework.EnableAutoscalerForMachineDeploymentTopologyAndWait(ctx, framework.EnableAutoscalerForMachineDeploymentTopologyAndWaitInput{
@@ -281,12 +281,6 @@ func AutoscalerSpec(ctx context.Context, inputGetter func() AutoscalerSpecInput)
281281
Replicas: 1,
282282
WaitForMachineDeployment: input.E2EConfig.GetIntervals(specName, "wait-controllers"),
283283
})
284-
285-
By("Deleting the MachineDeployment scale up deployment")
286-
framework.DeleteScaleUpDeploymentAndWait(ctx, framework.DeleteScaleUpDeploymentAndWaitInput{
287-
ClusterProxy: workloadClusterProxy,
288-
WaitForDelete: input.E2EConfig.GetIntervals(specName, "wait-autoscaler"),
289-
})
290284
}
291285

292286
By("Disabling the autoscaler for MachineDeployments to test MachinePools")
@@ -296,6 +290,12 @@ func AutoscalerSpec(ctx context.Context, inputGetter func() AutoscalerSpecInput)
296290
WaitForAnnotationsToBeDropped: input.E2EConfig.GetIntervals(specName, "wait-controllers"),
297291
})
298292

293+
By("Deleting the MachineDeployment scale up deployment")
294+
framework.DeleteScaleUpDeploymentAndWait(ctx, framework.DeleteScaleUpDeploymentAndWaitInput{
295+
ClusterProxy: workloadClusterProxy,
296+
WaitForDelete: input.E2EConfig.GetIntervals(specName, "wait-autoscaler"),
297+
})
298+
299299
if hasMachinePool {
300300
By("Enabling autoscaler for the MachinePool")
301301
// Enable autoscaler on the MachinePool.
@@ -359,13 +359,13 @@ func AutoscalerSpec(ctx context.Context, inputGetter func() AutoscalerSpecInput)
359359
WaitForMachinePool: input.E2EConfig.GetIntervals(specName, "wait-controllers"),
360360
})
361361

362-
By("Deleting the MachinePool scale up deployment")
363-
framework.DeleteScaleUpDeploymentAndWait(ctx, framework.DeleteScaleUpDeploymentAndWaitInput{
364-
ClusterProxy: workloadClusterProxy,
365-
WaitForDelete: input.E2EConfig.GetIntervals(specName, "wait-autoscaler"),
366-
})
367-
368362
if input.ScaleToAndFromZero {
363+
By("Deleting the MachinePool scale up deployment")
364+
framework.DeleteScaleUpDeploymentAndWait(ctx, framework.DeleteScaleUpDeploymentAndWaitInput{
365+
ClusterProxy: workloadClusterProxy,
366+
WaitForDelete: input.E2EConfig.GetIntervals(specName, "wait-autoscaler"),
367+
})
368+
369369
By("Enabling autoscaler for the MachinePool to zero")
370370
// Enable autoscaler on the MachinePool.
371371
framework.EnableAutoscalerForMachinePoolTopologyAndWait(ctx, framework.EnableAutoscalerForMachinePoolTopologyAndWaitInput{
@@ -396,12 +396,6 @@ func AutoscalerSpec(ctx context.Context, inputGetter func() AutoscalerSpecInput)
396396
Replicas: 1,
397397
WaitForMachinePool: input.E2EConfig.GetIntervals(specName, "wait-controllers"),
398398
})
399-
400-
By("Deleting the MachineDeployment scale up deployment")
401-
framework.DeleteScaleUpDeploymentAndWait(ctx, framework.DeleteScaleUpDeploymentAndWaitInput{
402-
ClusterProxy: workloadClusterProxy,
403-
WaitForDelete: input.E2EConfig.GetIntervals(specName, "wait-autoscaler"),
404-
})
405399
}
406400

407401
By("Disabling the autoscaler for MachineDeployments to test MachinePools")
@@ -410,6 +404,12 @@ func AutoscalerSpec(ctx context.Context, inputGetter func() AutoscalerSpecInput)
410404
Cluster: clusterResources.Cluster,
411405
WaitForAnnotationsToBeDropped: input.E2EConfig.GetIntervals(specName, "wait-controllers"),
412406
})
407+
408+
By("Deleting the MachineDeployment scale up deployment")
409+
framework.DeleteScaleUpDeploymentAndWait(ctx, framework.DeleteScaleUpDeploymentAndWaitInput{
410+
ClusterProxy: workloadClusterProxy,
411+
WaitForDelete: input.E2EConfig.GetIntervals(specName, "wait-autoscaler"),
412+
})
413413
}
414414

415415
By("PASSED!")

0 commit comments

Comments
 (0)