Skip to content

Commit

Permalink
Merge pull request #67469 from stewart-yu/stewart-controller-manager-…
Browse files Browse the repository at this point in the history
…kubecomponentconfig

Automatic merge from submit-queue (batch tested with PRs 65074, 67469). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Move kube-controller-manager ComponentConfig external types to `k8s.io/kube-controller-manager`

**What this PR does / why we need it**:
As the title describe:
split `kube-controller-manager` component api into their own packages:
      
- external component api located in `k8s.io/kube-controller-manager/config/v1alpha/types.go`;
- internal component api located in `pkg/controller/apis/config/types.go`


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #
ref: [kubernetes/community#2354](kubernetes/community#2354)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
  • Loading branch information
Kubernetes Submit Queue committed Sep 4, 2018
2 parents 789c361 + 3fd3e40 commit 1fc36a5
Show file tree
Hide file tree
Showing 79 changed files with 4,550 additions and 3,262 deletions.
206 changes: 103 additions & 103 deletions api/api-rules/violation_exceptions.list

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/controller-manager/app/options/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ go_library(
importpath = "k8s.io/kubernetes/cmd/controller-manager/app/options",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/componentconfig:go_default_library",
"//pkg/client/leaderelectionconfig:go_default_library",
"//pkg/controller/apis/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
Expand Down
4 changes: 2 additions & 2 deletions cmd/controller-manager/app/options/cloudprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/controller-manager/app/options/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/controller-manager/app/options/kubecloudshared.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/controller-manager/app/options/servicecontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/kube-controller-manager/app/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ go_library(
"//pkg/apis/autoscaling/install:go_default_library",
"//pkg/apis/batch/install:go_default_library",
"//pkg/apis/certificates/install:go_default_library",
"//pkg/apis/componentconfig:go_default_library",
"//pkg/apis/coordination/install:go_default_library",
"//pkg/apis/core/install:go_default_library",
"//pkg/apis/events/install:go_default_library",
Expand All @@ -41,6 +40,7 @@ go_library(
"//pkg/cloudprovider:go_default_library",
"//pkg/cloudprovider/providers:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/controller/apis/config:go_default_library",
"//pkg/controller/bootstrap:go_default_library",
"//pkg/controller/certificates/approver:go_default_library",
"//pkg/controller/certificates/cleaner:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cmd/kube-controller-manager/app/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/cmd/kube-controller-manager/app/config",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/componentconfig:go_default_library",
"//pkg/controller/apis/config:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/server:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/rest:go_default_library",
Expand Down
4 changes: 2 additions & 2 deletions cmd/kube-controller-manager/app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cmd/kube-controller-manager/app/controllermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions cmd/kube-controller-manager/app/options/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ go_library(
"//cmd/controller-manager/app/options:go_default_library",
"//cmd/kube-controller-manager/app/config:go_default_library",
"//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/componentconfig:go_default_library",
"//pkg/apis/componentconfig/v1alpha1:go_default_library",
"//pkg/controller/apis/config:go_default_library",
"//pkg/controller/apis/config/v1alpha1:go_default_library",
"//pkg/controller/garbagecollector:go_default_library",
"//pkg/features:go_default_library",
"//pkg/master/ports:go_default_library",
Expand All @@ -51,6 +51,7 @@ go_library(
"//staging/src/k8s.io/client-go/rest:go_default_library",
"//staging/src/k8s.io/client-go/tools/clientcmd:go_default_library",
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
"//staging/src/k8s.io/kube-controller-manager/config/v1alpha1:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
],
Expand All @@ -76,7 +77,7 @@ go_test(
tags = ["automanaged"],
deps = [
"//cmd/controller-manager/app/options:go_default_library",
"//pkg/apis/componentconfig:go_default_library",
"//pkg/controller/apis/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions cmd/kube-controller-manager/app/options/endpointcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/kube-controller-manager/app/options/hpacontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/kube-controller-manager/app/options/jobcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/kube-controller-manager/app/options/nodeipamcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
Loading

0 comments on commit 1fc36a5

Please sign in to comment.