diff --git a/pkg/cloud/azure/actuators/machine/actuator_test.go b/pkg/cloud/azure/actuators/machine/actuator_test.go index 7922ab0b5..01c88165e 100644 --- a/pkg/cloud/azure/actuators/machine/actuator_test.go +++ b/pkg/cloud/azure/actuators/machine/actuator_test.go @@ -658,7 +658,10 @@ func TestMachineEvents(t *testing.T) { for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { - cs := controllerfake.NewFakeClientWithScheme(scheme.Scheme, tc.credSecret, infra) + cs := controllerfake.NewClientBuilder().WithScheme(scheme.Scheme). + WithObjects(tc.credSecret, infra).WithStatusSubresource( + &machinev1.Machine{}, + ).Build() m := tc.machine.DeepCopy() if err := cs.Create(context.TODO(), m); err != nil { diff --git a/pkg/cloud/azure/actuators/machine_scope_test.go b/pkg/cloud/azure/actuators/machine_scope_test.go index b00d8e4e9..728c35fe9 100644 --- a/pkg/cloud/azure/actuators/machine_scope_test.go +++ b/pkg/cloud/azure/actuators/machine_scope_test.go @@ -255,8 +255,9 @@ func TestPersistMachineScope(t *testing.T) { } params := MachineScopeParams{ - Machine: machine, - CoreClient: controllerfake.NewFakeClientWithScheme(scheme.Scheme, testCredentialSecret(), infra), + Machine: machine, + CoreClient: controllerfake.NewClientBuilder().WithScheme(scheme.Scheme). + WithObjects(testCredentialSecret(), infra).WithStatusSubresource(&machinev1.Machine{}).Build(), } scope, err := NewMachineScope(params)