@@ -29,6 +29,7 @@ import (
2929 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030 "k8s.io/apimachinery/pkg/types"
3131 bootstrapapi "k8s.io/cluster-bootstrap/token/api"
32+ utilfeature "k8s.io/component-base/featuregate/testing"
3233 "k8s.io/utils/ptr"
3334 ctrl "sigs.k8s.io/controller-runtime"
3435 "sigs.k8s.io/controller-runtime/pkg/client"
@@ -725,7 +726,7 @@ func TestReconcileIfJoinCertificatesAvailableConditioninNodesAndControlPlaneIsRe
725726}
726727
727728func TestReconcileIfJoinNodePoolsAndControlPlaneIsReady (t * testing.T ) {
728- _ = feature .MutableGates . Set ( " MachinePool= true" )
729+ utilfeature . SetFeatureGateDuringTest ( t , feature . Gates , feature .MachinePool , true )
729730
730731 cluster := builder .Cluster (metav1 .NamespaceDefault , "cluster" ).Build ()
731732 cluster .Status .InfrastructureReady = true
@@ -1250,7 +1251,7 @@ func TestBootstrapTokenTTLExtension(t *testing.T) {
12501251}
12511252
12521253func TestBootstrapTokenRotationMachinePool (t * testing.T ) {
1253- _ = feature .MutableGates . Set ( " MachinePool= true" )
1254+ utilfeature . SetFeatureGateDuringTest ( t , feature . Gates , feature .MachinePool , true )
12541255 g := NewWithT (t )
12551256
12561257 cluster := builder .Cluster (metav1 .NamespaceDefault , "cluster" ).Build ()
@@ -1515,7 +1516,7 @@ func TestBootstrapTokenRefreshIfTokenSecretCleaned(t *testing.T) {
15151516 g .Expect (l .Items ).To (BeEmpty ())
15161517 })
15171518 t .Run ("should recreate the token for MachinePools" , func (t * testing.T ) {
1518- _ = feature .MutableGates . Set ( " MachinePool= true" )
1519+ utilfeature . SetFeatureGateDuringTest ( t , feature . Gates , feature .MachinePool , true )
15191520 g := NewWithT (t )
15201521
15211522 cluster := builder .Cluster (metav1 .NamespaceDefault , "cluster" ).Build ()
@@ -2002,7 +2003,7 @@ func TestKubeadmConfigReconciler_Reconcile_AlwaysCheckCAVerificationUnlessReques
20022003// If a cluster object changes then all associated KubeadmConfigs should be re-reconciled.
20032004// This allows us to not requeue a kubeadm config while we wait for InfrastructureReady.
20042005func TestKubeadmConfigReconciler_ClusterToKubeadmConfigs (t * testing.T ) {
2005- _ = feature .MutableGates . Set ( " MachinePool= true" )
2006+ utilfeature . SetFeatureGateDuringTest ( t , feature . Gates , feature .MachinePool , true )
20062007 g := NewWithT (t )
20072008
20082009 cluster := builder .Cluster (metav1 .NamespaceDefault , "my-cluster" ).Build ()
0 commit comments