From e3d53acb1f464a5cb9949eae7eb7f60a8ceefb79 Mon Sep 17 00:00:00 2001 From: DrmagicE <379342542@qq.com> Date: Sun, 21 Feb 2021 17:15:12 +0800 Subject: [PATCH] feat: Add --feature-gate flag to yurt-controller-manager --- cmd/yurt-controller-manager/app/options/options.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/yurt-controller-manager/app/options/options.go b/cmd/yurt-controller-manager/app/options/options.go index ec87cf5d358..1120fcb5aab 100644 --- a/cmd/yurt-controller-manager/app/options/options.go +++ b/cmd/yurt-controller-manager/app/options/options.go @@ -22,24 +22,26 @@ package options import ( "time" - yurtcontrollerconfig "github.com/openyurtio/openyurt/cmd/yurt-controller-manager/app/config" v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilerrors "k8s.io/apimachinery/pkg/util/errors" + utilfeature "k8s.io/apiserver/pkg/util/feature" clientset "k8s.io/client-go/kubernetes" clientgokubescheme "k8s.io/client-go/kubernetes/scheme" v1core "k8s.io/client-go/kubernetes/typed/core/v1" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/client-go/tools/record" cliflag "k8s.io/component-base/cli/flag" + componentbaseconfig "k8s.io/component-base/config" + "k8s.io/klog" kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" nodelifecycleconfig "k8s.io/kubernetes/pkg/controller/nodelifecycle/config" + yurtcontrollerconfig "github.com/openyurtio/openyurt/cmd/yurt-controller-manager/app/config" // add the kubernetes feature gates - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/leaderelection/resourcelock" - componentbaseconfig "k8s.io/component-base/config" - "k8s.io/klog" + _ "k8s.io/kubernetes/pkg/features" ) const ( @@ -102,7 +104,7 @@ func (s *YurtControllerManagerOptions) Flags(allControllers []string, disabledBy fs := fss.FlagSet("misc") fs.StringVar(&s.Master, "master", s.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig).") fs.StringVar(&s.Kubeconfig, "kubeconfig", s.Kubeconfig, "Path to kubeconfig file with authorization and master location information.") - //utilfeature.DefaultMutableFeatureGate.AddFlag(fss.FlagSet("generic")) + utilfeature.DefaultMutableFeatureGate.AddFlag(fss.FlagSet("generic")) fs.BoolVar(&s.Version, "version", s.Version, "print the version information.") return fss