mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 13:42:02 +00:00
cmd: silence warnings in kube-controller-manager/kube-apiserver, dedupe/color warnings in kubectl
This commit is contained in:
@@ -104,6 +104,13 @@ 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 {
|
||||
// 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()
|
||||
cliflag.PrintFlags(cmd.Flags())
|
||||
|
Reference in New Issue
Block a user