rebased for the use without NodeInfo

make fanout configureable via commanline

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Jonathon Anderson
2024-11-07 17:45:02 -07:00
parent 0490f4c9a5
commit 2e2a7d7de3
22 changed files with 304 additions and 250 deletions

View File

@@ -7,6 +7,7 @@ import (
type variables struct {
Showcmd bool
Fanout int
}
// GetRootCommand returns the root cobra.Command for the application.
@@ -16,7 +17,7 @@ func GetCommand() *cobra.Command {
DisableFlagsInUseLine: true,
Use: "soft",
Short: "Gracefully shuts down the given node(s)",
Long: "This command uses the operationg system to shut down the set of nodes specified by PATTERN.",
Long: "This command uses the operating system to shut down the set of nodes specified by PATTERN.",
RunE: CobraRunE(&vars),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) != 0 {
@@ -33,5 +34,6 @@ func GetCommand() *cobra.Command {
},
}
powerCmd.PersistentFlags().BoolVarP(&vars.Showcmd, "show", "s", false, "only show command which will be executed")
powerCmd.PersistentFlags().IntVar(&vars.Fanout, "fanout", 50, "how many command should be executed in parallel")
return powerCmd
}