Restored deleted kernel components for overrides

This commit is contained in:
Gregory Kurtzer
2022-02-17 06:21:40 +00:00
parent e88f18cb3f
commit 104bc7527d
22 changed files with 654 additions and 12 deletions

View File

@@ -4,6 +4,7 @@ import (
"log"
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/kernel"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/overlay"
"github.com/spf13/cobra"
@@ -36,6 +37,7 @@ var (
SetForce bool
SetComment string
SetContainer string
SetKernel string
SetKernelArgs string
SetClusterName string
SetIpxe string
@@ -77,6 +79,13 @@ func init() {
}); err != nil {
log.Println(err)
}
baseCmd.PersistentFlags().StringVarP(&SetKernel, "kernel", "K", "", "Set Kernel version for nodes")
if err := baseCmd.RegisterFlagCompletionFunc("kernel", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
list, _ := kernel.ListKernels()
return list, cobra.ShellCompDirectiveNoFileComp
}); err != nil {
log.Println(err)
}
baseCmd.PersistentFlags().StringVarP(&SetKernelArgs, "kernelargs", "A", "", "Set Kernel argument for nodes")
baseCmd.PersistentFlags().StringVarP(&SetClusterName, "cluster", "c", "", "Set the node's cluster group")
baseCmd.PersistentFlags().StringVarP(&SetIpxe, "ipxe", "P", "", "Set the node's iPXE template name")