Add glob support in subcommands add patch and add configmap

This commit is contained in:
Jingfang Liu
2018-08-01 15:10:46 -07:00
parent 55f8828ba1
commit bf73633cda
7 changed files with 103 additions and 30 deletions

View File

@@ -18,6 +18,8 @@ package commands
import (
"fmt"
"github.com/kubernetes-sigs/kustomize/pkg/fs"
)
// cMapFlagsAndArgs encapsulates the options for add configmap commands.
@@ -48,3 +50,12 @@ func (a *cMapFlagsAndArgs) Validate(args []string) error {
// TODO: Should we check if the path exists? if it's valid, if it's within the same (sub-)directory?
return nil
}
func (a *cMapFlagsAndArgs) ExpandFileSource(fSys fs.FileSystem) error {
result, err := globPatterns(fSys, a.FileSources)
if err != nil {
return err
}
a.FileSources = result
return nil
}