mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Merge pull request #892 from iwilltry42/master
[Enhancement] include subdirectories for auto-deploy manifests
This commit is contained in:
commit
265181715a
@ -85,10 +85,14 @@ func (w *watcher) listFiles(force bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *watcher) listFilesIn(base string, force bool) error {
|
func (w *watcher) listFilesIn(base string, force bool) error {
|
||||||
files, err := ioutil.ReadDir(base)
|
files := map[string]os.FileInfo{}
|
||||||
if os.IsNotExist(err) {
|
if err := filepath.Walk(base, func(path string, info os.FileInfo, err error) error {
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
files[path] = info
|
||||||
return nil
|
return nil
|
||||||
} else if err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,13 +104,12 @@ func (w *watcher) listFilesIn(base string, force bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var errs []error
|
var errs []error
|
||||||
for _, file := range files {
|
for path, file := range files {
|
||||||
if skipFile(file.Name(), skips) {
|
if skipFile(file.Name(), skips) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
p := filepath.Join(base, file.Name())
|
if err := w.deploy(path, !force); err != nil {
|
||||||
if err := w.deploy(p, !force); err != nil {
|
errs = append(errs, errors2.Wrapf(err, "failed to process %s", path))
|
||||||
errs = append(errs, errors2.Wrapf(err, "failed to process %s", p))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user