Skip to content

Commit

Permalink
osbuild-composer: fail weldr init when repos are nil
Browse files Browse the repository at this point in the history
If weldr tries to initialise when there are no repositories set and
ignore_missing_repos is enabled, return with an error.
  • Loading branch information
achilleas-k authored and lzap committed Nov 5, 2024
1 parent 51287ea commit af48971
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/osbuild-composer/composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ func NewComposer(config *ComposerConfigFile, stateDir, cacheDir string) (*Compos
}

func (c *Composer) InitWeldr(weldrListener net.Listener, distrosImageTypeDenylist map[string][]string) (err error) {
// Weldr requires repository definitions, so error out if none were loaded
if c.repos == nil {
return fmt.Errorf("weldr API requires repository definitions but none were loaded")
}
c.weldr, err = weldr.New(c.repos, c.stateDir, c.solver, c.distros, c.logger, c.workers, distrosImageTypeDenylist)
if err != nil {
return err
Expand Down

0 comments on commit af48971

Please sign in to comment.