diff --git a/api/v1beta2/awscluster_webhook_test.go b/api/v1beta2/awscluster_webhook_test.go index 41bc5d3b1c..18c0352f91 100644 --- a/api/v1beta2/awscluster_webhook_test.go +++ b/api/v1beta2/awscluster_webhook_test.go @@ -663,7 +663,7 @@ func TestAWSClusterValidateCreate(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.BootstrapFormatIgnition, true)() + utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.BootstrapFormatIgnition, true) cluster := tt.cluster.DeepCopy() cluster.ObjectMeta = metav1.ObjectMeta{ diff --git a/api/v1beta2/awsmachine_webhook_test.go b/api/v1beta2/awsmachine_webhook_test.go index 80e7abc45a..30c84e587e 100644 --- a/api/v1beta2/awsmachine_webhook_test.go +++ b/api/v1beta2/awsmachine_webhook_test.go @@ -439,7 +439,7 @@ func TestAWSMachineCreate(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.BootstrapFormatIgnition, true)() + utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.BootstrapFormatIgnition, true) machine := tt.machine.DeepCopy() machine.ObjectMeta = metav1.ObjectMeta{