From 48f453d64986ea9c01072e98b6f50139c831068c Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 8 Sep 2023 11:44:43 +0100 Subject: [PATCH] cloud-provider: Log additional options The 'NewCloudControllerManagerCommand' function create a cobra.Command object that is used for the main entry point to various CCM implementations. This function accepts an 'additionalFlags' parameter, allowing users to register additional controller-specific options beyond the standard set used for all controllers. While we were dumping the standard set of flags in the usage string - seen when running the command with '--help' or when parsing fails - we were not dumping the additional options. Correct this oversight. Signed-off-by: Stephen Finucane --- staging/src/k8s.io/cloud-provider/app/controllermanager.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/staging/src/k8s.io/cloud-provider/app/controllermanager.go b/staging/src/k8s.io/cloud-provider/app/controllermanager.go index 56fd0053136..75d38a4e2f6 100644 --- a/staging/src/k8s.io/cloud-provider/app/controllermanager.go +++ b/staging/src/k8s.io/cloud-provider/app/controllermanager.go @@ -150,11 +150,13 @@ the cloud specific control loops shipped with Kubernetes.`, cmd.SetUsageFunc(func(cmd *cobra.Command) error { fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine()) cliflag.PrintSections(cmd.OutOrStderr(), namedFlagSets, cols) + cliflag.PrintSections(cmd.OutOrStderr(), additionalFlags, cols) return nil }) cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) { fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n"+usageFmt, cmd.Long, cmd.UseLine()) cliflag.PrintSections(cmd.OutOrStdout(), namedFlagSets, cols) + cliflag.PrintSections(cmd.OutOrStdout(), additionalFlags, cols) }) return cmd