From 6a90b7f780118eda6067bb271448c0971b2e9ed9 Mon Sep 17 00:00:00 2001 From: stewart-yu Date: Mon, 3 Sep 2018 22:45:47 +0800 Subject: [PATCH] [kube-controller-manager] fix some reference from cmd/*-controller-manager about kubeControllerManagerConfiguration --- .../app/options/cloudprovider.go | 4 ++-- cmd/controller-manager/app/options/generic.go | 6 ++--- .../app/options/kubecloudshared.go | 6 ++--- .../app/options/servicecontroller.go | 4 ++-- .../app/config/config.go | 4 ++-- .../app/controllermanager.go | 4 ++-- .../app/options/attachdetachcontroller.go | 4 ++-- .../app/options/csrsigningcontroller.go | 4 ++-- .../app/options/daemonsetcontroller.go | 4 ++-- .../app/options/deploymentcontroller.go | 4 ++-- .../app/options/deprecatedcontroller.go | 6 ++--- .../app/options/endpointcontroller.go | 4 ++-- .../app/options/garbagecollectorcontroller.go | 6 ++--- .../app/options/hpacontroller.go | 4 ++-- .../app/options/jobcontroller.go | 4 ++-- .../app/options/namespacecontroller.go | 4 ++-- .../app/options/nodeipamcontroller.go | 4 ++-- .../app/options/nodelifecyclecontroller.go | 4 ++-- .../app/options/options.go | 23 ++++++++++--------- .../app/options/options_test.go | 10 ++++---- .../persistentvolumebindercontroller.go | 6 ++--- .../app/options/podgccontroller.go | 4 ++-- .../app/options/replicasetcontroller.go | 4 ++-- .../app/options/replicationcontroller.go | 4 ++-- .../app/options/resourcequotacontroller.go | 4 ++-- .../app/options/serviceaccountcontroller.go | 4 ++-- cmd/kube-controller-manager/app/plugins.go | 18 +++++++-------- 27 files changed, 79 insertions(+), 78 deletions(-) diff --git a/cmd/controller-manager/app/options/cloudprovider.go b/cmd/controller-manager/app/options/cloudprovider.go index 37a340e3b5..2c22d1b3f1 100644 --- a/cmd/controller-manager/app/options/cloudprovider.go +++ b/cmd/controller-manager/app/options/cloudprovider.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // CloudProviderOptions holds the cloudprovider options. @@ -44,7 +44,7 @@ func (s *CloudProviderOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up cloudprovider config with options. -func (s *CloudProviderOptions) ApplyTo(cfg *componentconfig.CloudProviderConfiguration) error { +func (s *CloudProviderOptions) ApplyTo(cfg *kubectrlmgrconfig.CloudProviderConfiguration) error { if s == nil { return nil } diff --git a/cmd/controller-manager/app/options/generic.go b/cmd/controller-manager/app/options/generic.go index 61c4c41f89..3056038f40 100644 --- a/cmd/controller-manager/app/options/generic.go +++ b/cmd/controller-manager/app/options/generic.go @@ -25,8 +25,8 @@ import ( "k8s.io/apimachinery/pkg/util/sets" apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserverflag "k8s.io/apiserver/pkg/util/flag" - "k8s.io/kubernetes/pkg/apis/componentconfig" "k8s.io/kubernetes/pkg/client/leaderelectionconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // GenericControllerManagerConfigurationOptions holds the options which are generic. @@ -44,7 +44,7 @@ type GenericControllerManagerConfigurationOptions struct { // NewGenericControllerManagerConfigurationOptions returns generic configuration default values for both // the kube-controller-manager and the cloud-contoller-manager. Any common changes should // be made here. Any individual changes should be made in that controller. -func NewGenericControllerManagerConfigurationOptions(cfg componentconfig.GenericControllerManagerConfiguration) *GenericControllerManagerConfigurationOptions { +func NewGenericControllerManagerConfigurationOptions(cfg kubectrlmgrconfig.GenericControllerManagerConfiguration) *GenericControllerManagerConfigurationOptions { o := &GenericControllerManagerConfigurationOptions{ Port: cfg.Port, Address: cfg.Address, @@ -82,7 +82,7 @@ func (o *GenericControllerManagerConfigurationOptions) AddFlags(fss *apiserverfl } // ApplyTo fills up generic config with options. -func (o *GenericControllerManagerConfigurationOptions) ApplyTo(cfg *componentconfig.GenericControllerManagerConfiguration) error { +func (o *GenericControllerManagerConfigurationOptions) ApplyTo(cfg *kubectrlmgrconfig.GenericControllerManagerConfiguration) error { if o == nil { return nil } diff --git a/cmd/controller-manager/app/options/kubecloudshared.go b/cmd/controller-manager/app/options/kubecloudshared.go index 2d777915f9..956571892b 100644 --- a/cmd/controller-manager/app/options/kubecloudshared.go +++ b/cmd/controller-manager/app/options/kubecloudshared.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // KubeCloudSharedOptions holds the options shared between kube-controller-manager @@ -43,7 +43,7 @@ type KubeCloudSharedOptions struct { // NewKubeCloudSharedOptions returns common/default configuration values for both // the kube-controller-manager and the cloud-contoller-manager. Any common changes should // be made here. Any individual changes should be made in that controller. -func NewKubeCloudSharedOptions(cfg componentconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions { +func NewKubeCloudSharedOptions(cfg kubectrlmgrconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions { o := &KubeCloudSharedOptions{ CloudProvider: &CloudProviderOptions{}, ExternalCloudVolumePlugin: cfg.ExternalCloudVolumePlugin, @@ -84,7 +84,7 @@ func (o *KubeCloudSharedOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up KubeCloudShared config with options. -func (o *KubeCloudSharedOptions) ApplyTo(cfg *componentconfig.KubeCloudSharedConfiguration) error { +func (o *KubeCloudSharedOptions) ApplyTo(cfg *kubectrlmgrconfig.KubeCloudSharedConfiguration) error { if o == nil { return nil } diff --git a/cmd/controller-manager/app/options/servicecontroller.go b/cmd/controller-manager/app/options/servicecontroller.go index b14142eca9..f6b7ab628b 100644 --- a/cmd/controller-manager/app/options/servicecontroller.go +++ b/cmd/controller-manager/app/options/servicecontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // ServiceControllerOptions holds the ServiceController options. @@ -37,7 +37,7 @@ func (o *ServiceControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up ServiceController config with options. -func (o *ServiceControllerOptions) ApplyTo(cfg *componentconfig.ServiceControllerConfiguration) error { +func (o *ServiceControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.ServiceControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/config/config.go b/cmd/kube-controller-manager/app/config/config.go index eafc6a3858..d3125b4a51 100644 --- a/cmd/kube-controller-manager/app/config/config.go +++ b/cmd/kube-controller-manager/app/config/config.go @@ -21,12 +21,12 @@ import ( clientset "k8s.io/client-go/kubernetes" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // Config is the main context object for the controller manager. type Config struct { - ComponentConfig componentconfig.KubeControllerManagerConfiguration + ComponentConfig kubectrlmgrconfig.KubeControllerManagerConfiguration SecureServing *apiserver.SecureServingInfo // LoopbackClientConfig is a config for a privileged loopback connection diff --git a/cmd/kube-controller-manager/app/controllermanager.go b/cmd/kube-controller-manager/app/controllermanager.go index ba1df52136..12e7c35fae 100644 --- a/cmd/kube-controller-manager/app/controllermanager.go +++ b/cmd/kube-controller-manager/app/controllermanager.go @@ -50,9 +50,9 @@ import ( genericcontrollermanager "k8s.io/kubernetes/cmd/controller-manager/app" "k8s.io/kubernetes/cmd/kube-controller-manager/app/config" "k8s.io/kubernetes/cmd/kube-controller-manager/app/options" - "k8s.io/kubernetes/pkg/apis/componentconfig" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/controller" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" serviceaccountcontroller "k8s.io/kubernetes/pkg/controller/serviceaccount" "k8s.io/kubernetes/pkg/serviceaccount" "k8s.io/kubernetes/pkg/util/configz" @@ -250,7 +250,7 @@ type ControllerContext struct { InformerFactory informers.SharedInformerFactory // ComponentConfig provides access to init options for a given controller - ComponentConfig componentconfig.KubeControllerManagerConfiguration + ComponentConfig kubectrlmgrconfig.KubeControllerManagerConfiguration // DeferredDiscoveryRESTMapper is a RESTMapper that will defer // initialization of the RESTMapper until the first mapping is diff --git a/cmd/kube-controller-manager/app/options/attachdetachcontroller.go b/cmd/kube-controller-manager/app/options/attachdetachcontroller.go index 8f620f4b95..ea0102c567 100644 --- a/cmd/kube-controller-manager/app/options/attachdetachcontroller.go +++ b/cmd/kube-controller-manager/app/options/attachdetachcontroller.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // AttachDetachControllerOptions holds the AttachDetachController options. @@ -40,7 +40,7 @@ func (o *AttachDetachControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up AttachDetachController config with options. -func (o *AttachDetachControllerOptions) ApplyTo(cfg *componentconfig.AttachDetachControllerConfiguration) error { +func (o *AttachDetachControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.AttachDetachControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/csrsigningcontroller.go b/cmd/kube-controller-manager/app/options/csrsigningcontroller.go index acd9d9be28..3ddb7cd645 100644 --- a/cmd/kube-controller-manager/app/options/csrsigningcontroller.go +++ b/cmd/kube-controller-manager/app/options/csrsigningcontroller.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) const ( @@ -52,7 +52,7 @@ func (o *CSRSigningControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up CSRSigningController config with options. -func (o *CSRSigningControllerOptions) ApplyTo(cfg *componentconfig.CSRSigningControllerConfiguration) error { +func (o *CSRSigningControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.CSRSigningControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/daemonsetcontroller.go b/cmd/kube-controller-manager/app/options/daemonsetcontroller.go index 2d3d3f526a..c0e3ec0492 100644 --- a/cmd/kube-controller-manager/app/options/daemonsetcontroller.go +++ b/cmd/kube-controller-manager/app/options/daemonsetcontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // DaemonSetControllerOptions holds the DaemonSetController options. @@ -35,7 +35,7 @@ func (o *DaemonSetControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up DaemonSetController config with options. -func (o *DaemonSetControllerOptions) ApplyTo(cfg *componentconfig.DaemonSetControllerConfiguration) error { +func (o *DaemonSetControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.DaemonSetControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/deploymentcontroller.go b/cmd/kube-controller-manager/app/options/deploymentcontroller.go index 481ffad448..b497a3e756 100644 --- a/cmd/kube-controller-manager/app/options/deploymentcontroller.go +++ b/cmd/kube-controller-manager/app/options/deploymentcontroller.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // DeploymentControllerOptions holds the DeploymentController options. @@ -40,7 +40,7 @@ func (o *DeploymentControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up DeploymentController config with options. -func (o *DeploymentControllerOptions) ApplyTo(cfg *componentconfig.DeploymentControllerConfiguration) error { +func (o *DeploymentControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.DeploymentControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/deprecatedcontroller.go b/cmd/kube-controller-manager/app/options/deprecatedcontroller.go index b65683725a..904abac06c 100644 --- a/cmd/kube-controller-manager/app/options/deprecatedcontroller.go +++ b/cmd/kube-controller-manager/app/options/deprecatedcontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // DeprecatedControllerOptions holds the DeprecatedController options, those option are deprecated. @@ -46,12 +46,12 @@ func (o *DeprecatedControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up DeprecatedController config with options. -func (o *DeprecatedControllerOptions) ApplyTo(cfg *componentconfig.DeprecatedControllerConfiguration) error { +func (o *DeprecatedControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.DeprecatedControllerConfiguration) error { if o == nil { return nil } - cfg.DeletingPodsQps = o.DeletingPodsQPS + cfg.DeletingPodsQPS = o.DeletingPodsQPS cfg.DeletingPodsBurst = o.DeletingPodsBurst cfg.RegisterRetryCount = o.RegisterRetryCount diff --git a/cmd/kube-controller-manager/app/options/endpointcontroller.go b/cmd/kube-controller-manager/app/options/endpointcontroller.go index 7db7b0e311..c3b224cecb 100644 --- a/cmd/kube-controller-manager/app/options/endpointcontroller.go +++ b/cmd/kube-controller-manager/app/options/endpointcontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // EndpointControllerOptions holds the EndPointController options. @@ -37,7 +37,7 @@ func (o *EndpointControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up EndPointController config with options. -func (o *EndpointControllerOptions) ApplyTo(cfg *componentconfig.EndpointControllerConfiguration) error { +func (o *EndpointControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.EndpointControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/garbagecollectorcontroller.go b/cmd/kube-controller-manager/app/options/garbagecollectorcontroller.go index 73d4e5fcd5..07b63f6f57 100644 --- a/cmd/kube-controller-manager/app/options/garbagecollectorcontroller.go +++ b/cmd/kube-controller-manager/app/options/garbagecollectorcontroller.go @@ -19,13 +19,13 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // GarbageCollectorControllerOptions holds the GarbageCollectorController options. type GarbageCollectorControllerOptions struct { ConcurrentGCSyncs int32 - GCIgnoredResources []componentconfig.GroupResource + GCIgnoredResources []kubectrlmgrconfig.GroupResource EnableGarbageCollector bool } @@ -40,7 +40,7 @@ func (o *GarbageCollectorControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up GarbageCollectorController config with options. -func (o *GarbageCollectorControllerOptions) ApplyTo(cfg *componentconfig.GarbageCollectorControllerConfiguration) error { +func (o *GarbageCollectorControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.GarbageCollectorControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/hpacontroller.go b/cmd/kube-controller-manager/app/options/hpacontroller.go index 40ee7f4df8..de39131a1f 100644 --- a/cmd/kube-controller-manager/app/options/hpacontroller.go +++ b/cmd/kube-controller-manager/app/options/hpacontroller.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // HPAControllerOptions holds the HPAController options. @@ -54,7 +54,7 @@ func (o *HPAControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up HPAController config with options. -func (o *HPAControllerOptions) ApplyTo(cfg *componentconfig.HPAControllerConfiguration) error { +func (o *HPAControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.HPAControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/jobcontroller.go b/cmd/kube-controller-manager/app/options/jobcontroller.go index 97dc027728..d9d715c2ba 100644 --- a/cmd/kube-controller-manager/app/options/jobcontroller.go +++ b/cmd/kube-controller-manager/app/options/jobcontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // JobControllerOptions holds the JobController options. @@ -35,7 +35,7 @@ func (o *JobControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up JobController config with options. -func (o *JobControllerOptions) ApplyTo(cfg *componentconfig.JobControllerConfiguration) error { +func (o *JobControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.JobControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/namespacecontroller.go b/cmd/kube-controller-manager/app/options/namespacecontroller.go index b6cd5e63ab..90a771b781 100644 --- a/cmd/kube-controller-manager/app/options/namespacecontroller.go +++ b/cmd/kube-controller-manager/app/options/namespacecontroller.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // NamespaceControllerOptions holds the NamespaceController options. @@ -40,7 +40,7 @@ func (o *NamespaceControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up NamespaceController config with options. -func (o *NamespaceControllerOptions) ApplyTo(cfg *componentconfig.NamespaceControllerConfiguration) error { +func (o *NamespaceControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.NamespaceControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/nodeipamcontroller.go b/cmd/kube-controller-manager/app/options/nodeipamcontroller.go index 0f36188a27..6e2ecb96af 100644 --- a/cmd/kube-controller-manager/app/options/nodeipamcontroller.go +++ b/cmd/kube-controller-manager/app/options/nodeipamcontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // NodeIPAMControllerOptions holds the NodeIpamController options. @@ -39,7 +39,7 @@ func (o *NodeIPAMControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up NodeIpamController config with options. -func (o *NodeIPAMControllerOptions) ApplyTo(cfg *componentconfig.NodeIPAMControllerConfiguration) error { +func (o *NodeIPAMControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.NodeIPAMControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/nodelifecyclecontroller.go b/cmd/kube-controller-manager/app/options/nodelifecyclecontroller.go index 6c3ddeb09b..956543fe04 100644 --- a/cmd/kube-controller-manager/app/options/nodelifecyclecontroller.go +++ b/cmd/kube-controller-manager/app/options/nodelifecyclecontroller.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // NodeLifecycleControllerOptions holds the NodeLifecycleController options. @@ -56,7 +56,7 @@ func (o *NodeLifecycleControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up NodeLifecycleController config with options. -func (o *NodeLifecycleControllerOptions) ApplyTo(cfg *componentconfig.NodeLifecycleControllerConfiguration) error { +func (o *NodeLifecycleControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.NodeLifecycleControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/options.go b/cmd/kube-controller-manager/app/options/options.go index 6ffeeff71c..56178e9ed5 100644 --- a/cmd/kube-controller-manager/app/options/options.go +++ b/cmd/kube-controller-manager/app/options/options.go @@ -33,11 +33,12 @@ import ( restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/record" + kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1" cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options" kubecontrollerconfig "k8s.io/kubernetes/cmd/kube-controller-manager/app/config" "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/apis/componentconfig" - componentconfigv1alpha1 "k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" + kubectrlmgrschemev1alpha1 "k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1" "k8s.io/kubernetes/pkg/controller/garbagecollector" "k8s.io/kubernetes/pkg/master/ports" @@ -189,9 +190,9 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) { s.SecureServing.ServerCert.PairName = "kube-controller-manager" s.SecureServing.BindPort = ports.KubeControllerManagerPort - gcIgnoredResources := make([]componentconfig.GroupResource, 0, len(garbagecollector.DefaultIgnoredResources())) + gcIgnoredResources := make([]kubectrlmgrconfig.GroupResource, 0, len(garbagecollector.DefaultIgnoredResources())) for r := range garbagecollector.DefaultIgnoredResources() { - gcIgnoredResources = append(gcIgnoredResources, componentconfig.GroupResource{Group: r.Group, Resource: r.Resource}) + gcIgnoredResources = append(gcIgnoredResources, kubectrlmgrconfig.GroupResource{Group: r.Group, Resource: r.Resource}) } s.GarbageCollectorController.GCIgnoredResources = gcIgnoredResources @@ -200,19 +201,19 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) { } // NewDefaultComponentConfig returns kube-controller manager configuration object. -func NewDefaultComponentConfig(insecurePort int32) (componentconfig.KubeControllerManagerConfiguration, error) { +func NewDefaultComponentConfig(insecurePort int32) (kubectrlmgrconfig.KubeControllerManagerConfiguration, error) { scheme := runtime.NewScheme() - if err := componentconfigv1alpha1.AddToScheme(scheme); err != nil { - return componentconfig.KubeControllerManagerConfiguration{}, err + if err := kubectrlmgrschemev1alpha1.AddToScheme(scheme); err != nil { + return kubectrlmgrconfig.KubeControllerManagerConfiguration{}, err } - if err := componentconfig.AddToScheme(scheme); err != nil { - return componentconfig.KubeControllerManagerConfiguration{}, err + if err := kubectrlmgrconfig.AddToScheme(scheme); err != nil { + return kubectrlmgrconfig.KubeControllerManagerConfiguration{}, err } - versioned := componentconfigv1alpha1.KubeControllerManagerConfiguration{} + versioned := kubectrlmgrconfigv1alpha1.KubeControllerManagerConfiguration{} scheme.Default(&versioned) - internal := componentconfig.KubeControllerManagerConfiguration{} + internal := kubectrlmgrconfig.KubeControllerManagerConfiguration{} if err := scheme.Convert(&versioned, &internal, nil); err != nil { return internal, err } diff --git a/cmd/kube-controller-manager/app/options/options_test.go b/cmd/kube-controller-manager/app/options/options_test.go index c7d47ddaa9..5a59471ac4 100644 --- a/cmd/kube-controller-manager/app/options/options_test.go +++ b/cmd/kube-controller-manager/app/options/options_test.go @@ -31,7 +31,7 @@ import ( apiserverconfig "k8s.io/apiserver/pkg/apis/config" apiserveroptions "k8s.io/apiserver/pkg/server/options" cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) func TestAddFlags(t *testing.T) { @@ -185,7 +185,7 @@ func TestAddFlags(t *testing.T) { }, GarbageCollectorController: &GarbageCollectorControllerOptions{ ConcurrentGCSyncs: 30, - GCIgnoredResources: []componentconfig.GroupResource{ + GCIgnoredResources: []kubectrlmgrconfig.GroupResource{ {Group: "", Resource: "events"}, }, EnableGarbageCollector: false, @@ -222,11 +222,11 @@ func TestAddFlags(t *testing.T) { }, PersistentVolumeBinderController: &PersistentVolumeBinderControllerOptions{ PVClaimBinderSyncPeriod: metav1.Duration{Duration: 30 * time.Second}, - VolumeConfiguration: componentconfig.VolumeConfiguration{ + VolumeConfiguration: kubectrlmgrconfig.VolumeConfiguration{ EnableDynamicProvisioning: false, EnableHostPathProvisioning: true, FlexVolumePluginDir: "/flex-volume-plugin", - PersistentVolumeRecyclerConfiguration: componentconfig.PersistentVolumeRecyclerConfiguration{ + PersistentVolumeRecyclerConfiguration: kubectrlmgrconfig.PersistentVolumeRecyclerConfiguration{ MaximumRetry: 3, MinimumTimeoutNFS: 200, IncrementTimeoutNFS: 45, @@ -298,7 +298,7 @@ func TestAddFlags(t *testing.T) { } } -type sortedGCIgnoredResources []componentconfig.GroupResource +type sortedGCIgnoredResources []kubectrlmgrconfig.GroupResource func (r sortedGCIgnoredResources) Len() int { return len(r) diff --git a/cmd/kube-controller-manager/app/options/persistentvolumebindercontroller.go b/cmd/kube-controller-manager/app/options/persistentvolumebindercontroller.go index ba7e05ccc0..93ba171b07 100644 --- a/cmd/kube-controller-manager/app/options/persistentvolumebindercontroller.go +++ b/cmd/kube-controller-manager/app/options/persistentvolumebindercontroller.go @@ -20,13 +20,13 @@ import ( "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // PersistentVolumeBinderControllerOptions holds the PersistentVolumeBinderController options. type PersistentVolumeBinderControllerOptions struct { PVClaimBinderSyncPeriod metav1.Duration - VolumeConfiguration componentconfig.VolumeConfiguration + VolumeConfiguration kubectrlmgrconfig.VolumeConfiguration } // AddFlags adds flags related to PersistentVolumeBinderController for controller manager to the specified FlagSet. @@ -48,7 +48,7 @@ func (o *PersistentVolumeBinderControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up PersistentVolumeBinderController config with options. -func (o *PersistentVolumeBinderControllerOptions) ApplyTo(cfg *componentconfig.PersistentVolumeBinderControllerConfiguration) error { +func (o *PersistentVolumeBinderControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.PersistentVolumeBinderControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/podgccontroller.go b/cmd/kube-controller-manager/app/options/podgccontroller.go index 9af9c4429a..0d9928aee1 100644 --- a/cmd/kube-controller-manager/app/options/podgccontroller.go +++ b/cmd/kube-controller-manager/app/options/podgccontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // PodGCControllerOptions holds the PodGCController options. @@ -37,7 +37,7 @@ func (o *PodGCControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up PodGCController config with options. -func (o *PodGCControllerOptions) ApplyTo(cfg *componentconfig.PodGCControllerConfiguration) error { +func (o *PodGCControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.PodGCControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/replicasetcontroller.go b/cmd/kube-controller-manager/app/options/replicasetcontroller.go index 67a6acdd00..2a3e206fd1 100644 --- a/cmd/kube-controller-manager/app/options/replicasetcontroller.go +++ b/cmd/kube-controller-manager/app/options/replicasetcontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // ReplicaSetControllerOptions holds the ReplicaSetController options. @@ -37,7 +37,7 @@ func (o *ReplicaSetControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up ReplicaSetController config with options. -func (o *ReplicaSetControllerOptions) ApplyTo(cfg *componentconfig.ReplicaSetControllerConfiguration) error { +func (o *ReplicaSetControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.ReplicaSetControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/replicationcontroller.go b/cmd/kube-controller-manager/app/options/replicationcontroller.go index 0b79bf3340..3e24dc5aae 100644 --- a/cmd/kube-controller-manager/app/options/replicationcontroller.go +++ b/cmd/kube-controller-manager/app/options/replicationcontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // ReplicationControllerOptions holds the ReplicationController options. @@ -37,7 +37,7 @@ func (o *ReplicationControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up ReplicationController config with options. -func (o *ReplicationControllerOptions) ApplyTo(cfg *componentconfig.ReplicationControllerConfiguration) error { +func (o *ReplicationControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.ReplicationControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/resourcequotacontroller.go b/cmd/kube-controller-manager/app/options/resourcequotacontroller.go index 1d89320e5a..5bb1f07a52 100644 --- a/cmd/kube-controller-manager/app/options/resourcequotacontroller.go +++ b/cmd/kube-controller-manager/app/options/resourcequotacontroller.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // ResourceQuotaControllerOptions holds the ResourceQuotaController options. @@ -40,7 +40,7 @@ func (o *ResourceQuotaControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up ResourceQuotaController config with options. -func (o *ResourceQuotaControllerOptions) ApplyTo(cfg *componentconfig.ResourceQuotaControllerConfiguration) error { +func (o *ResourceQuotaControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.ResourceQuotaControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/options/serviceaccountcontroller.go b/cmd/kube-controller-manager/app/options/serviceaccountcontroller.go index e29099199e..88a40b46bd 100644 --- a/cmd/kube-controller-manager/app/options/serviceaccountcontroller.go +++ b/cmd/kube-controller-manager/app/options/serviceaccountcontroller.go @@ -19,7 +19,7 @@ package options import ( "github.com/spf13/pflag" - "k8s.io/kubernetes/pkg/apis/componentconfig" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" ) // SAControllerOptions holds the ServiceAccountController options. @@ -41,7 +41,7 @@ func (o *SAControllerOptions) AddFlags(fs *pflag.FlagSet) { } // ApplyTo fills up ServiceAccountController config with options. -func (o *SAControllerOptions) ApplyTo(cfg *componentconfig.SAControllerConfiguration) error { +func (o *SAControllerOptions) ApplyTo(cfg *kubectrlmgrconfig.SAControllerConfiguration) error { if o == nil { return nil } diff --git a/cmd/kube-controller-manager/app/plugins.go b/cmd/kube-controller-manager/app/plugins.go index 5b0fe113e6..ba9bb40de9 100644 --- a/cmd/kube-controller-manager/app/plugins.go +++ b/cmd/kube-controller-manager/app/plugins.go @@ -23,14 +23,12 @@ import ( "fmt" - // Cloud providers - "k8s.io/kubernetes/pkg/apis/componentconfig" - _ "k8s.io/kubernetes/pkg/cloudprovider/providers" - "k8s.io/utils/exec" - - // Volume plugins "github.com/golang/glog" + + // Cloud providers "k8s.io/kubernetes/pkg/cloudprovider" + _ "k8s.io/kubernetes/pkg/cloudprovider/providers" + // Volume plugins "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume/aws_ebs" "k8s.io/kubernetes/pkg/volume/azure_dd" @@ -56,7 +54,9 @@ import ( "k8s.io/kubernetes/pkg/volume/vsphere_volume" utilfeature "k8s.io/apiserver/pkg/util/feature" + kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" "k8s.io/kubernetes/pkg/features" + "k8s.io/utils/exec" ) // ProbeAttachableVolumePlugins collects all volume plugins for the attach/ @@ -87,12 +87,12 @@ func ProbeAttachableVolumePlugins() []volume.VolumePlugin { // GetDynamicPluginProber gets the probers of dynamically discoverable plugins // for the attach/detach controller. // Currently only Flexvolume plugins are dynamically discoverable. -func GetDynamicPluginProber(config componentconfig.VolumeConfiguration) volume.DynamicPluginProber { +func GetDynamicPluginProber(config kubectrlmgrconfig.VolumeConfiguration) volume.DynamicPluginProber { return flexvolume.GetDynamicPluginProber(config.FlexVolumePluginDir, exec.New() /*exec.Interface*/) } // ProbeExpandableVolumePlugins returns volume plugins which are expandable -func ProbeExpandableVolumePlugins(config componentconfig.VolumeConfiguration) []volume.VolumePlugin { +func ProbeExpandableVolumePlugins(config kubectrlmgrconfig.VolumeConfiguration) []volume.VolumePlugin { allPlugins := []volume.VolumePlugin{} allPlugins = append(allPlugins, aws_ebs.ProbeVolumePlugins()...) @@ -114,7 +114,7 @@ func ProbeExpandableVolumePlugins(config componentconfig.VolumeConfiguration) [] // ProbeControllerVolumePlugins collects all persistent volume plugins into an // easy to use list. Only volume plugins that implement any of // provisioner/recycler/deleter interface should be returned. -func ProbeControllerVolumePlugins(cloud cloudprovider.Interface, config componentconfig.VolumeConfiguration) []volume.VolumePlugin { +func ProbeControllerVolumePlugins(cloud cloudprovider.Interface, config kubectrlmgrconfig.VolumeConfiguration) []volume.VolumePlugin { allPlugins := []volume.VolumePlugin{} // The list of plugins to probe is decided by this binary, not