Skip to content

Commit be1bb7a

Browse files
fabriziopandinik8s-infra-cherrypick-robot
authored and
k8s-infra-cherrypick-robot
committed
Fix unit test
1 parent 5d60723 commit be1bb7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

controlplane/kubeadm/internal/controllers/helpers_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ func TestCloneConfigsAndGenerateMachine(t *testing.T) {
374374
bootstrapSpec := &bootstrapv1.KubeadmConfigSpec{
375375
JoinConfiguration: &bootstrapv1.JoinConfiguration{},
376376
}
377-
g.Expect(r.cloneConfigsAndGenerateMachine(ctx, cluster, kcp, bootstrapSpec, nil)).To(Succeed())
377+
_, err := r.cloneConfigsAndGenerateMachine(ctx, cluster, kcp, bootstrapSpec, nil)
378+
g.Expect(err).To(Succeed())
378379

379380
machineList := &clusterv1.MachineList{}
380381
g.Expect(env.GetAPIReader().List(ctx, machineList, client.InNamespace(cluster.Namespace))).To(Succeed())
@@ -463,7 +464,8 @@ func TestCloneConfigsAndGenerateMachineFail(t *testing.T) {
463464

464465
// Try to break Infra Cloning
465466
kcp.Spec.MachineTemplate.InfrastructureRef.Name = "something_invalid"
466-
g.Expect(r.cloneConfigsAndGenerateMachine(ctx, cluster, kcp, bootstrapSpec, nil)).To(HaveOccurred())
467+
_, err := r.cloneConfigsAndGenerateMachine(ctx, cluster, kcp, bootstrapSpec, nil)
468+
g.Expect(err).To(HaveOccurred())
467469
g.Expect(&kcp.GetConditions()[0]).Should(conditions.HaveSameStateOf(&clusterv1.Condition{
468470
Type: controlplanev1.MachinesCreatedCondition,
469471
Status: corev1.ConditionFalse,

0 commit comments

Comments
 (0)