Respect rootfs path for load config

This commit is contained in:
Daniele Rondina
2020-11-07 18:28:23 +01:00
parent 76328176c1
commit ebe7466fdc
3 changed files with 26 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ package repository
import (
"io/ioutil"
"path"
"path/filepath"
"regexp"
"github.com/ghodss/yaml"
@@ -30,7 +31,16 @@ import (
func LoadRepositories(c *LuetConfig) error {
var regexRepo = regexp.MustCompile(`.yml$|.yaml$`)
// Respect the rootfs param on read repositories
rootfs, err := c.GetSystem().GetRootFsAbs()
if err != nil {
return err
}
for _, rdir := range c.RepositoriesConfDir {
rdir = filepath.Join(rootfs, rdir)
Debug("Parsing Repository Directory", rdir, "...")
files, err := ioutil.ReadDir(rdir)