From feaa78380c59f95676ef7dd1d8935492cfeafcca Mon Sep 17 00:00:00 2001 From: yxxhero Date: Sun, 17 Oct 2021 18:57:23 +0800 Subject: [PATCH] Optimize Cobra parameters of Controller Manager Signed-off-by: yxxhero --- cmd/kube-controller-manager/app/controllermanager.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/kube-controller-manager/app/controllermanager.go b/cmd/kube-controller-manager/app/controllermanager.go index 8ec7afe0758..f7d01190a40 100644 --- a/cmd/kube-controller-manager/app/controllermanager.go +++ b/cmd/kube-controller-manager/app/controllermanager.go @@ -119,12 +119,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 Kubernetes today are the replication controller, endpoints controller, namespace controller, and serviceaccounts controller.`, - PersistentPreRunE: func(*cobra.Command, []string) error { + PersistentPreRun: func(*cobra.Command, []string) { // silence client-go warnings. // kube-controller-manager generically watches APIs (including deprecated ones), // and CI ensures it works properly against matching kube-apiserver versions. restclient.SetDefaultWarningHandler(restclient.NoWarnings{}) - return nil }, Run: func(cmd *cobra.Command, args []string) { verflag.PrintAndExitIfRequested()