diff --git a/staging/src/k8s.io/controller-manager/pkg/leadermigration/feature.go b/staging/src/k8s.io/controller-manager/pkg/leadermigration/feature.go deleted file mode 100644 index f9803d5ba28..00000000000 --- a/staging/src/k8s.io/controller-manager/pkg/leadermigration/feature.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package leadermigration - -import ( - _ "k8s.io/controller-manager/pkg/features/register" -) - -// FeatureEnabled tells if leader migration is enabled through the feature gate. -func FeatureEnabled() bool { - return true -} diff --git a/staging/src/k8s.io/controller-manager/pkg/leadermigration/options/options.go b/staging/src/k8s.io/controller-manager/pkg/leadermigration/options/options.go index 5bd078ec782..abbd75e6f81 100644 --- a/staging/src/k8s.io/controller-manager/pkg/leadermigration/options/options.go +++ b/staging/src/k8s.io/controller-manager/pkg/leadermigration/options/options.go @@ -21,7 +21,6 @@ import ( "github.com/spf13/pflag" "k8s.io/controller-manager/config" - "k8s.io/controller-manager/pkg/leadermigration" migrationconfig "k8s.io/controller-manager/pkg/leadermigration/config" ) @@ -65,9 +64,6 @@ func (o *LeaderMigrationOptions) ApplyTo(cfg *config.GenericControllerManagerCon cfg.LeaderMigrationEnabled = false return nil } - if o.Enabled && !leadermigration.FeatureEnabled() { - return fmt.Errorf("Leader Migration is not enabled through feature gate") - } cfg.LeaderMigrationEnabled = o.Enabled if !cfg.LeaderMigrationEnabled { return nil diff --git a/staging/src/k8s.io/controller-manager/pkg/leadermigration/util.go b/staging/src/k8s.io/controller-manager/pkg/leadermigration/util.go index 83eacc0df24..d4476393738 100644 --- a/staging/src/k8s.io/controller-manager/pkg/leadermigration/util.go +++ b/staging/src/k8s.io/controller-manager/pkg/leadermigration/util.go @@ -21,5 +21,5 @@ import config "k8s.io/controller-manager/config" // Enabled checks whether Leader Migration should be enabled, given the GenericControllerManagerConfiguration. // It considers the feature gate first, and will always return false if the feature gate is not enabled. func Enabled(genericConfig *config.GenericControllerManagerConfiguration) bool { - return FeatureEnabled() && genericConfig.LeaderElection.LeaderElect && genericConfig.LeaderMigrationEnabled + return genericConfig.LeaderElection.LeaderElect && genericConfig.LeaderMigrationEnabled }