mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
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 <stephenfin@redhat.com>
This commit is contained in:
parent
c084719291
commit
48f453d649
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user