Configure nodes.conf path dynamically from config
Removes the use of init() to initialize the variable. - Closes: #1596 - See also: #1569 Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -7,17 +7,15 @@ import (
|
||||
"github.com/warewulf/warewulf/internal/app/wwctl/upgrade/nodes"
|
||||
)
|
||||
|
||||
var (
|
||||
Command = &cobra.Command{
|
||||
func GetCommand() *cobra.Command {
|
||||
command := &cobra.Command{
|
||||
DisableFlagsInUseLine: true,
|
||||
Use: "upgrade <config|nodes> [OPTIONS]",
|
||||
Short: "Upgrade configuration files",
|
||||
Long: `Upgrade warewulf.conf or nodes.conf from a previous version of Warewulf 4 to a format
|
||||
supported by the current version.`,
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
Command.AddCommand(config.Command)
|
||||
Command.AddCommand(nodes.Command)
|
||||
command.AddCommand(config.GetCommand())
|
||||
command.AddCommand(nodes.GetCommand())
|
||||
return command
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user