diff --git a/internal/app/wwctl/overlay/build/main.go b/internal/app/wwctl/overlay/build/main.go index 324cfc3e..56698bff 100644 --- a/internal/app/wwctl/overlay/build/main.go +++ b/internal/app/wwctl/overlay/build/main.go @@ -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