Merge pull request #105721 from yxxhero/optimize_controllermanger_cobra_param

Optimize Cobra parameters of Controller Manager
This commit is contained in:
Kubernetes Prow Robot 2022-01-04 11:26:50 -08:00 committed by GitHub
commit 28bda67fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,12 +107,11 @@ state of the cluster through the apiserver and makes changes attempting to move
current state towards the desired state. Examples of controllers that ship with current state towards the desired state. Examples of controllers that ship with
Kubernetes today are the replication controller, endpoints controller, namespace Kubernetes today are the replication controller, endpoints controller, namespace
controller, and serviceaccounts controller.`, controller, and serviceaccounts controller.`,
PersistentPreRunE: func(*cobra.Command, []string) error { PersistentPreRun: func(*cobra.Command, []string) {
// silence client-go warnings. // silence client-go warnings.
// kube-controller-manager generically watches APIs (including deprecated ones), // kube-controller-manager generically watches APIs (including deprecated ones),
// and CI ensures it works properly against matching kube-apiserver versions. // and CI ensures it works properly against matching kube-apiserver versions.
restclient.SetDefaultWarningHandler(restclient.NoWarnings{}) restclient.SetDefaultWarningHandler(restclient.NoWarnings{})
return nil
}, },
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
verflag.PrintAndExitIfRequested() verflag.PrintAndExitIfRequested()