Explicitly enforce the number or arguments accepted by some wwctl subcommands. #1717
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
### Changed
|
||||
|
||||
- Update GitHub actions to build aarch64 artifacts.
|
||||
- Explicitly enforce the number or arguments accepted by some `wwctl` subcommands. #1717
|
||||
|
||||
### Removed
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ var (
|
||||
Long: "wwclient fetches the runtime overlay and puts it on the disk",
|
||||
RunE: CobraRunE,
|
||||
SilenceUsage: true,
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
DebugFlag bool
|
||||
PIDFile string
|
||||
|
||||
@@ -17,6 +17,7 @@ var (
|
||||
Long: "This application allows you to manage and initialize Warewulf dependent system\n" +
|
||||
"services based on the configuration in the warewulf.conf file.",
|
||||
RunE: CobraRunE,
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
allFunctions bool
|
||||
)
|
||||
|
||||
@@ -13,6 +13,7 @@ var (
|
||||
Short: "Delete an imported image",
|
||||
Long: "This command will delete IMAGEs that have been imported into Warewulf.",
|
||||
RunE: CobraRunE,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
if len(args) != 0 {
|
||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||
|
||||
@@ -23,6 +23,7 @@ func GetCommand() *cobra.Command {
|
||||
Long: "This command will show you the images that are imported into Warewulf.",
|
||||
RunE: CobraRunE(&vars),
|
||||
Aliases: []string{"ls"},
|
||||
Args: cobra.ArbitraryArgs,
|
||||
ValidArgsFunction: completions.Images,
|
||||
}
|
||||
baseCmd.PersistentFlags().BoolVarP(&vars.full, "long", "l", false, "show all")
|
||||
|
||||
@@ -23,6 +23,7 @@ var baseCmd = &cobra.Command{
|
||||
"node images. These commands will help you import, manage, and transform\n" +
|
||||
"images into bootable Warewulf images.",
|
||||
Aliases: []string{"vnfs", "container"},
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -13,6 +13,7 @@ var (
|
||||
Long: "This command opens an editor for the given nodes.",
|
||||
RunE: CobraRunE,
|
||||
ValidArgsFunction: completions.Nodes,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
}
|
||||
NoHeader bool
|
||||
)
|
||||
|
||||
@@ -13,6 +13,7 @@ var (
|
||||
Long: "This command exports the given nodes as yaml to stdout.",
|
||||
RunE: CobraRunE,
|
||||
ValidArgsFunction: completions.Nodes,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
}
|
||||
NoHeader bool
|
||||
)
|
||||
|
||||
@@ -25,6 +25,7 @@ func GetCommand() *cobra.Command {
|
||||
RunE: CobraRunE(&vars),
|
||||
Aliases: []string{"ls"},
|
||||
ValidArgsFunction: completions.Nodes,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
}
|
||||
baseCmd.PersistentFlags().BoolVarP(&vars.showNet, "net", "n", false, "Show node network configurations")
|
||||
baseCmd.PersistentFlags().BoolVarP(&vars.showIpmi, "ipmi", "i", false, "Show node IPMI configurations")
|
||||
|
||||
@@ -23,6 +23,7 @@ var (
|
||||
"node ranges. For example: n00[00-4].cluster[0-1] will identify the first 5 nodes\n" +
|
||||
"in cluster0 and cluster1.",
|
||||
Aliases: []string{"nodes"},
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ var (
|
||||
Long: "View and monitor the status of nodes as they are provisioned and check in.",
|
||||
RunE: CobraRunE,
|
||||
ValidArgsFunction: completions.Nodes,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
}
|
||||
SetWatch bool
|
||||
SetUpdate int
|
||||
|
||||
@@ -13,6 +13,7 @@ var (
|
||||
Long: "This command builds overlays for given nodes.",
|
||||
RunE: CobraRunE,
|
||||
ValidArgsFunction: completions.Nodes,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
}
|
||||
OverlayNames []string
|
||||
OverlayDir string
|
||||
|
||||
@@ -14,6 +14,7 @@ var (
|
||||
RunE: CobraRunE,
|
||||
Aliases: []string{"ls"},
|
||||
ValidArgsFunction: completions.Overlays,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
}
|
||||
ListContents bool
|
||||
ListLong bool
|
||||
|
||||
@@ -20,6 +20,7 @@ var (
|
||||
Use: "overlay COMMAND [OPTIONS]",
|
||||
Short: "Warewulf Overlay Management",
|
||||
Long: "Management interface for Warewulf overlays",
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ var (
|
||||
Use: "power COMMAND [OPTIONS]",
|
||||
Short: "Warewulf node power management",
|
||||
Long: "This command controls the power state of nodes.",
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ func GetCommand() *cobra.Command {
|
||||
Aliases: []string{"new", "create"},
|
||||
RunE: CobraRunE(&vars),
|
||||
ValidArgsFunction: completions.None,
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
}
|
||||
vars.profileConf.CreateFlags(baseCmd)
|
||||
vars.profileAdd.CreateAddFlags(baseCmd)
|
||||
|
||||
@@ -13,6 +13,7 @@ var (
|
||||
Long: "This command opens an editor for the given profiles.",
|
||||
RunE: CobraRunE,
|
||||
ValidArgsFunction: completions.Profiles,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
}
|
||||
NoHeader bool
|
||||
)
|
||||
|
||||
@@ -22,6 +22,7 @@ func GetCommand() *cobra.Command {
|
||||
RunE: CobraRunE(&vars),
|
||||
Aliases: []string{"ls"},
|
||||
ValidArgsFunction: completions.Profiles,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
}
|
||||
baseCmd.PersistentFlags().BoolVarP(&vars.showAll, "all", "a", false, "Show all profile configurations")
|
||||
baseCmd.PersistentFlags().BoolVarP(&vars.showYaml, "yaml", "y", false, "Show profile configurations via yaml format")
|
||||
|
||||
@@ -15,6 +15,7 @@ var (
|
||||
Use: "profile COMMAND [OPTIONS]",
|
||||
Short: "Node configuration profile management",
|
||||
Long: "Management of node profile settings",
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ func GetCommand() *cobra.Command {
|
||||
Aliases: []string{"modify"},
|
||||
RunE: CobraRunE(&vars),
|
||||
ValidArgsFunction: completions.Profiles,
|
||||
Args: cobra.ArbitraryArgs,
|
||||
}
|
||||
vars.profileConf.CreateFlags(baseCmd)
|
||||
vars.profileDel.CreateDelFlags(baseCmd)
|
||||
|
||||
@@ -30,6 +30,7 @@ var (
|
||||
PersistentPreRunE: rootPersistentPreRunE,
|
||||
SilenceUsage: true,
|
||||
SilenceErrors: true,
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
verboseArg bool
|
||||
DebugFlag bool
|
||||
|
||||
Reference in New Issue
Block a user