@@ -2086,7 +2086,7 @@ func TestReconcileMachinePhases(t *testing.T) {
20862086
20872087 // Wait until InfraMachine has the ownerReference.
20882088 g .Eventually (func (g Gomega ) bool {
2089- if err := env .Get (ctx , client .ObjectKeyFromObject (infraMachine ), infraMachine ); err != nil {
2089+ if err := env .DirectAPIServerGet (ctx , client .ObjectKeyFromObject (infraMachine ), infraMachine ); err != nil {
20902090 return false
20912091 }
20922092 g .Expect (infraMachine .GetOwnerReferences ()).To (HaveLen (1 ))
@@ -2129,7 +2129,7 @@ func TestReconcileMachinePhases(t *testing.T) {
21292129
21302130 // Wait until Machine was reconciled.
21312131 g .Eventually (func (g Gomega ) bool {
2132- if err := env .Get (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
2132+ if err := env .DirectAPIServerGet (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
21332133 return false
21342134 }
21352135 g .Expect (machine .Status .GetTypedPhase ()).To (Equal (clusterv1 .MachinePhasePending ))
@@ -2184,7 +2184,7 @@ func TestReconcileMachinePhases(t *testing.T) {
21842184
21852185 // Wait until Machine was reconciled.
21862186 g .Eventually (func (g Gomega ) bool {
2187- if err := env .Get (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
2187+ if err := env .DirectAPIServerGet (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
21882188 return false
21892189 }
21902190 g .Expect (machine .Status .GetTypedPhase ()).To (Equal (clusterv1 .MachinePhaseProvisioning ))
@@ -2274,7 +2274,7 @@ func TestReconcileMachinePhases(t *testing.T) {
22742274
22752275 // Wait until Machine was reconciled.
22762276 g .Eventually (func (g Gomega ) bool {
2277- if err := env .Get (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
2277+ if err := env .DirectAPIServerGet (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
22782278 return false
22792279 }
22802280 g .Expect (machine .Status .Addresses ).To (HaveLen (2 ))
@@ -2354,7 +2354,7 @@ func TestReconcileMachinePhases(t *testing.T) {
23542354
23552355 // Wait until Machine was reconciled.
23562356 g .Eventually (func (g Gomega ) bool {
2357- if err := env .Get (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
2357+ if err := env .DirectAPIServerGet (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
23582358 return false
23592359 }
23602360 g .Expect (machine .Status .GetTypedPhase ()).To (Equal (clusterv1 .MachinePhaseRunning ))
@@ -2433,7 +2433,7 @@ func TestReconcileMachinePhases(t *testing.T) {
24332433
24342434 // Wait until Machine was reconciled.
24352435 g .Eventually (func (g Gomega ) bool {
2436- if err := env .Get (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
2436+ if err := env .DirectAPIServerGet (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
24372437 return false
24382438 }
24392439 g .Expect (machine .Status .GetTypedPhase ()).To (Equal (clusterv1 .MachinePhaseRunning ))
@@ -2496,7 +2496,7 @@ func TestReconcileMachinePhases(t *testing.T) {
24962496
24972497 // Wait until Machine was reconciled.
24982498 g .Eventually (func (g Gomega ) bool {
2499- if err := env .Get (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
2499+ if err := env .DirectAPIServerGet (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
25002500 return false
25012501 }
25022502 g .Expect (machine .Status .GetTypedPhase ()).To (Equal (clusterv1 .MachinePhaseProvisioned ))
@@ -2590,7 +2590,7 @@ func TestReconcileMachinePhases(t *testing.T) {
25902590
25912591 // Wait until Machine was reconciled.
25922592 g .Eventually (func (g Gomega ) bool {
2593- if err := env .Get (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
2593+ if err := env .DirectAPIServerGet (ctx , client .ObjectKeyFromObject (machine ), machine ); err != nil {
25942594 return false
25952595 }
25962596 g .Expect (machine .Status .GetTypedPhase ()).To (Equal (clusterv1 .MachinePhaseDeleting ))
0 commit comments