dynamic nouns for 'wwwctl container'

This commit is contained in:
Christian Goll
2021-09-24 10:50:54 +02:00
parent c097c15b13
commit 8010cd2435
3 changed files with 32 additions and 5 deletions

View File

@@ -1,6 +1,9 @@
package build
import "github.com/spf13/cobra"
import (
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/spf13/cobra"
)
var (
baseCmd = &cobra.Command{
@@ -9,6 +12,13 @@ var (
Long: "This command will build a bootable VNFS image from an imported container image.",
RunE: CobraRunE,
Args: cobra.MinimumNArgs(1),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) != 0 {
return nil, cobra.ShellCompDirectiveNoFileComp
}
list, _ := container.ListSources()
return list, cobra.ShellCompDirectiveNoFileComp
},
}
BuildForce bool
BuildAll bool