wwctl upgrade args and completions

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-02-09 15:37:09 -07:00
parent ee3ac172a0
commit 862cc8163f
2 changed files with 8 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/spf13/cobra"
"github.com/warewulf/warewulf/internal/app/wwctl/completions"
"github.com/warewulf/warewulf/internal/pkg/config"
"github.com/warewulf/warewulf/internal/pkg/upgrade"
"github.com/warewulf/warewulf/internal/pkg/util"
@@ -23,7 +24,9 @@ func GetCommand() *cobra.Command {
Short: "Upgrade an existing warewulf.conf",
Long: `Upgrades warewulf.conf from a previous version of Warewulf 4 to a format
supported by the current version.`,
RunE: UpgradeNodesConf,
RunE: UpgradeNodesConf,
Args: cobra.NoArgs,
ValidArgsFunction: completions.None,
}
command.Flags().StringVarP(&inputPath, "input-path", "i", "", "Path to a legacy warewulf.conf")
command.Flags().StringVarP(&outputPath, "output-path", "o", "", "Path to write the upgraded warewulf.conf to")

View File

@@ -6,6 +6,7 @@ import (
"github.com/spf13/cobra"
"github.com/warewulf/warewulf/internal/app/wwctl/completions"
"github.com/warewulf/warewulf/internal/pkg/config"
"github.com/warewulf/warewulf/internal/pkg/upgrade"
"github.com/warewulf/warewulf/internal/pkg/util"
@@ -26,7 +27,9 @@ func GetCommand() *cobra.Command {
Short: "Upgrade an existing nodes.conf",
Long: `Upgrades nodes.conf from a previous version of Warewulf 4 to a format
supported by the current version.`,
RunE: UpgradeNodesConf,
RunE: UpgradeNodesConf,
Args: cobra.NoArgs,
ValidArgsFunction: completions.None,
}
command.Flags().BoolVar(&addDefaults, "add-defaults", false, "Configure a default profile and set default node values")
command.Flags().BoolVar(&replaceOverlays, "replace-overlays", false, "Replace 'wwinit' and 'generic' overlays with their split replacements")