distro: register distros explicitly
Automatically registering on `init()` is clever, but a bit too magical and easy to get wrong, because every binary must include all distros somewhere. Flip this inside out: distros now have a `New()`, which returns something that implements the `Distro` interface. The distro package explicitly creates all of them. This means that distros cannot import distro itself anymore, because go forbids import cycles. This only affected `InvalidOutputFormatError`. Return a generic error for now.
This commit is contained in:
parent
673d3ff14b
commit
14ebed46da
10 changed files with 26 additions and 35 deletions
|
|
@ -15,13 +15,11 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/pipeline"
|
||||
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/target"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
_ "github.com/osbuild/osbuild-composer/internal/distro/fedora30"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue