Merge pull request #264 from MatthewHink/mhink-container
Fix container build --all. #215.
This commit is contained in:
20
internal/app/wwctl/container/build/build_test.go
Normal file
20
internal/app/wwctl/container/build/build_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package build
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestArgsContainerBuild is a regression test for 215.
|
||||
func TestArgsContainerBuild(t *testing.T) {
|
||||
command := GetCommand()
|
||||
|
||||
err := command.Args(command, []string{})
|
||||
if err != nil {
|
||||
t.Errorf("no arguments to container build should succeed.")
|
||||
}
|
||||
|
||||
err = command.Args(command, []string{"container1", "container2"})
|
||||
if err != nil {
|
||||
t.Errorf("multiple arguments to container build should succeed.")
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
Short: "(Re)build a bootable VNFS image",
|
||||
Long: "This command will build a bootable VNFS image from imported CONTAINER image(s).",
|
||||
RunE: CobraRunE,
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
Args: cobra.ArbitraryArgs,
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
if len(args) != 0 {
|
||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||
|
||||
Reference in New Issue
Block a user