Skip to content

Commit

Permalink
composer: use reporegistry.New() again (see PR#4378)
Browse files Browse the repository at this point in the history
This commit changes cmd/composer to use the `reporegistry.New`
call again. This is a preparation for
osbuild/images#1179

And undoes parts of osbuild#4378
but that is no longer necessary because in
osbuild/images#946 the error is now passed
on from `reporegistry.New()` in the same way as from `LoadRepositories()`.
  • Loading branch information
mvo5 committed Jan 29, 2025
1 parent 4bffb70 commit bc149ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/osbuild-composer/composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ func NewComposer(config *ComposerConfigFile, stateDir, cacheDir string) (*Compos
return nil, fmt.Errorf("failed to configure distro aliases: %v", err)
}

repoConfigs, err := reporegistry.LoadAllRepositories(repositoryConfigs)
c.repos, err = reporegistry.New(repositoryConfigs)
switch err.(type) {
case nil:
// fine
case *reporegistry.NoReposLoadedError:
if !c.config.IgnoreMissingRepos {
return nil, fmt.Errorf("error loading repository definitions: %w", err)
}
// running without repositories is allowed: log message and continue
logrus.Info(err.Error())
logrus.Info("ignore_missing_repos enabled: continuing")
case nil:
c.repos = reporegistry.NewFromDistrosRepoConfigs(repoConfigs)
default:
return nil, fmt.Errorf("error loading repository definitions: %w", err)
}
Expand Down

0 comments on commit bc149ca

Please sign in to comment.