Skip to content

Commit 3bd4963

Browse files
author
Cecile Robert-Michon
committed
Update machinepool_helpers.go
1 parent 856cb3c commit 3bd4963

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/framework/machinepool_helpers.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,10 @@ func UpgradeMachinePoolAndWait(ctx context.Context, input UpgradeMachinePoolAndW
134134
patchHelper, err := patch.NewHelper(mp, mgmtClient)
135135
Expect(err).ToNot(HaveOccurred())
136136

137+
oldVersion := mp.Spec.Template.Spec.Version
137138
mp.Spec.Template.Spec.Version = &input.UpgradeVersion
138139
Expect(patchHelper.Patch(ctx, mp)).To(Succeed())
139-
}
140140

141-
for i := range input.MachinePools {
142-
mp := input.MachinePools[i]
143-
oldVersion := mp.Spec.Template.Spec.Version
144141
log.Logf("Waiting for Kubernetes versions of machines in MachinePool %s/%s to be upgraded from %s to %s",
145142
mp.Namespace, mp.Name, *oldVersion, input.UpgradeVersion)
146143
WaitForMachinePoolInstancesToBeUpgraded(ctx, WaitForMachinePoolInstancesToBeUpgradedInput{
@@ -216,7 +213,7 @@ func WaitForMachinePoolInstancesToBeUpgraded(ctx context.Context, input WaitForM
216213
return 0, err
217214
}
218215
versions := getMachinePoolInstanceVersions(ctx, GetMachinesPoolInstancesInput{
219-
Getter: input.Getter,
216+
Getter: input.WorkloadClusterGetter,
220217
Namespace: input.Cluster.Namespace,
221218
MachinePool: input.MachinePool,
222219
})

0 commit comments

Comments
 (0)