Skip to content

Commit

Permalink
remove unused option deployment-controller-sync-period for deployment…
Browse files Browse the repository at this point in the history
… controller
  • Loading branch information
SataQiu committed Mar 30, 2022
1 parent 2e55595 commit 9ac1b4b
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 38 deletions.
1 change: 0 additions & 1 deletion api/api-rules/violation_exceptions.list
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,C
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,CronJobControllerConfiguration,ConcurrentCronJobSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,DaemonSetControllerConfiguration,ConcurrentDaemonSetSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,DeploymentControllerConfiguration,ConcurrentDeploymentSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,DeploymentControllerConfiguration,DeploymentControllerSyncPeriod
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,DeprecatedControllerConfiguration,DeletingPodsBurst
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,DeprecatedControllerConfiguration,DeletingPodsQPS
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,DeprecatedControllerConfiguration,RegisterRetryCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ func (o *DeploymentControllerOptions) AddFlags(fs *pflag.FlagSet) {
}

fs.Int32Var(&o.ConcurrentDeploymentSyncs, "concurrent-deployment-syncs", o.ConcurrentDeploymentSyncs, "The number of deployment objects that are allowed to sync concurrently. Larger number = more responsive deployments, but more CPU (and network) load")
fs.DurationVar(&o.DeploymentControllerSyncPeriod.Duration, "deployment-controller-sync-period", o.DeploymentControllerSyncPeriod.Duration, "Period for syncing the deployments.")
fs.MarkDeprecated("deployment-controller-sync-period", "This flag is currently no-op and will be removed in v1.24.")
}

// ApplyTo fills up DeploymentController config with options.
Expand All @@ -45,7 +43,6 @@ func (o *DeploymentControllerOptions) ApplyTo(cfg *deploymentconfig.DeploymentCo
}

cfg.ConcurrentDeploymentSyncs = o.ConcurrentDeploymentSyncs
cfg.DeploymentControllerSyncPeriod = o.DeploymentControllerSyncPeriod

return nil
}
Expand Down
7 changes: 2 additions & 5 deletions cmd/kube-controller-manager/app/options/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ var args = []string{
"--contention-profiling=true",
"--controller-start-interval=2m",
"--controllers=foo,bar",
"--deployment-controller-sync-period=45s",
"--disable-attach-detach-reconcile-sync=true",
"--enable-dynamic-provisioning=false",
"--enable-garbage-collector=false",
Expand Down Expand Up @@ -258,8 +257,7 @@ func TestAddFlags(t *testing.T) {
},
DeploymentController: &DeploymentControllerOptions{
&deploymentconfig.DeploymentControllerConfiguration{
ConcurrentDeploymentSyncs: 10,
DeploymentControllerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
ConcurrentDeploymentSyncs: 10,
},
},
StatefulSetController: &StatefulSetControllerOptions{
Expand Down Expand Up @@ -531,8 +529,7 @@ func TestApplyTo(t *testing.T) {
ConcurrentDaemonSetSyncs: 2,
},
DeploymentController: deploymentconfig.DeploymentControllerConfiguration{
ConcurrentDeploymentSyncs: 10,
DeploymentControllerSyncPeriod: metav1.Duration{Duration: 45 * time.Second},
ConcurrentDeploymentSyncs: 10,
},
StatefulSetController: statefulsetconfig.StatefulSetControllerConfiguration{
ConcurrentStatefulSetSyncs: 15,
Expand Down
6 changes: 0 additions & 6 deletions pkg/controller/deployment/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,10 @@ limitations under the License.

package config

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// DeploymentControllerConfiguration contains elements describing DeploymentController.
type DeploymentControllerConfiguration struct {
// concurrentDeploymentSyncs is the number of deployment objects that are
// allowed to sync concurrently. Larger number = more responsive deployments,
// but more CPU (and network) load.
ConcurrentDeploymentSyncs int32
// deploymentControllerSyncPeriod is the period for syncing the deployments.
DeploymentControllerSyncPeriod metav1.Duration
}
7 changes: 0 additions & 7 deletions pkg/controller/deployment/config/v1alpha1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ limitations under the License.
package v1alpha1

import (
"time"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
)

Expand All @@ -33,11 +30,7 @@ import (
// be no easy way to opt-out. Instead, if you want to use this defaulting method
// run it in your wrapper struct of this type in its `SetDefaults_` method.
func RecommendedDefaultDeploymentControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.DeploymentControllerConfiguration) {
zero := metav1.Duration{}
if obj.ConcurrentDeploymentSyncs == 0 {
obj.ConcurrentDeploymentSyncs = 5
}
if obj.DeploymentControllerSyncPeriod == zero {
obj.DeploymentControllerSyncPeriod = metav1.Duration{Duration: 30 * time.Second}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pkg/controller/deployment/config/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions pkg/generated/openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ type DeploymentControllerConfiguration struct {
// allowed to sync concurrently. Larger number = more responsive deployments,
// but more CPU (and network) load.
ConcurrentDeploymentSyncs int32
// deploymentControllerSyncPeriod is the period for syncing the deployments.
DeploymentControllerSyncPeriod metav1.Duration
}

// StatefulSetControllerConfiguration contains elements describing StatefulSetController.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9ac1b4b

Please sign in to comment.