From f973733130f31da16c978e39469fe33611b7722f Mon Sep 17 00:00:00 2001 From: xu yang Date: Mon, 30 Sep 2024 04:34:11 +0000 Subject: [PATCH] wwctl node set requires mandatory pattern input Signed-off-by: xu yang --- CHANGELOG.md | 1 + internal/app/wwctl/node/set/root.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab09f7b7..500a9039 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Disable building containers by default when calling `wwctl container copy`. #1378 - Split wwinit and generic overlays into discrete functionality. #987 - Updated IgnitionJson to sort filesystems. #1433 +- `wwctl node set` requires mandatory pattern input. #502 ### Fixed diff --git a/internal/app/wwctl/node/set/root.go b/internal/app/wwctl/node/set/root.go index 7adbc44d..b966a272 100644 --- a/internal/app/wwctl/node/set/root.go +++ b/internal/app/wwctl/node/set/root.go @@ -31,11 +31,11 @@ func GetCommand() *cobra.Command { vars.nodeConf = node.NewConf() baseCmd := &cobra.Command{ DisableFlagsInUseLine: true, - Use: "set [OPTIONS] PATTERN [PATTERN ...]", + Use: "set [OPTIONS] PATTERN", Short: "Configure node properties", Long: "This command sets configuration properties for nodes matching PATTERN.\n\nNote: use the string 'UNSET' to remove a configuration", Aliases: []string{"modify"}, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), // require pattern as a mandatory arg RunE: CobraRunE(&vars), ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { if len(args) != 0 {