fixup for backward compatible case
This commit is contained in:
@@ -3,6 +3,7 @@ package build
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/node"
|
||||
"github.com/hpcng/warewulf/internal/pkg/overlay"
|
||||
@@ -39,6 +40,15 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: this is to keep backward compatible
|
||||
// passing -O a,b,c versus -O a -O b -O c, but will also accept -O a,b -O c
|
||||
overlayNames := []string{}
|
||||
for _, name := range OverlayNames {
|
||||
names := strings.Split(name, ",")
|
||||
overlayNames = append(overlayNames, names...)
|
||||
}
|
||||
OverlayNames = overlayNames
|
||||
|
||||
if OverlayDir != "" {
|
||||
if len(OverlayNames) == 0 {
|
||||
// TODO: should this behave the same as OverlayDir == "", and build default
|
||||
|
||||
Reference in New Issue
Block a user