Move RepoRegistry setup into Composer
This is so that both the weldr and cloud api's can use it as the source of their repositories.
This commit is contained in:
parent
f660ed65b6
commit
b8967d53bc
3 changed files with 14 additions and 13 deletions
|
|
@ -156,7 +156,7 @@ func NewTestAPI(solver *dnfjson.BaseSolver, rr *reporegistry.RepoRegistry,
|
|||
return setupRouter(api)
|
||||
}
|
||||
|
||||
func New(repoPaths []string, stateDir string, solver *dnfjson.BaseSolver, df *distrofactory.Factory,
|
||||
func New(rr *reporegistry.RepoRegistry, stateDir string, solver *dnfjson.BaseSolver, df *distrofactory.Factory,
|
||||
logger *log.Logger, workers *worker.Server, distrosImageTypeDenylist map[string][]string) (*API, error) {
|
||||
if logger == nil {
|
||||
logger = log.New(os.Stdout, "", 0)
|
||||
|
|
@ -168,14 +168,6 @@ func New(repoPaths []string, stateDir string, solver *dnfjson.BaseSolver, df *di
|
|||
}
|
||||
hostArch := arch.Current().String()
|
||||
|
||||
rr, err := reporegistry.New(repoPaths)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error loading repository definitions: %v", err)
|
||||
}
|
||||
|
||||
// Clean up the cache, removes unknown distros and files
|
||||
solver.CleanupOldCacheDirs(rr.ListDistros())
|
||||
|
||||
hostDistro := df.GetDistro(hostDistroName)
|
||||
if hostDistro != nil {
|
||||
// get canonical distro name if the host distro is supported
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue