Support kernel overrides from the host or other containers

This commit is contained in:
Gregory Kurtzer
2022-02-17 07:37:04 +00:00
parent 104bc7527d
commit 1203186194
19 changed files with 90 additions and 68 deletions

View File

@@ -37,7 +37,7 @@ var (
SetForce bool
SetComment string
SetContainer string
SetKernel string
SetKernelOverride string
SetKernelArgs string
SetClusterName string
SetIpxe string
@@ -79,8 +79,8 @@ 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) {
baseCmd.PersistentFlags().StringVarP(&SetKernelOverride, "kerneloverride", "K", "", "Set kernel override version for nodes")
if err := baseCmd.RegisterFlagCompletionFunc("kerneloverride", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
list, _ := kernel.ListKernels()
return list, cobra.ShellCompDirectiveNoFileComp
}); err != nil {