distroregistry: add a default distroregistry
This commit adds NewDefault() method to distroregistry that returns a slice with all distributions supported by osbuild-composer. This way, there's only one place where a distribution needs to be defined while its support is being added to composer. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
dd4db353e2
commit
3c715c7cf8
3 changed files with 33 additions and 14 deletions
|
|
@ -9,10 +9,6 @@ import (
|
|||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/distro/fedora32"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro/fedora33"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro/rhel8"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro/rhel84"
|
||||
"github.com/osbuild/osbuild-composer/internal/distroregistry"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
|
|
@ -68,7 +64,7 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
distros, err := distroregistry.New(fedora32.New(), fedora33.New(), rhel8.New(), rhel84.New(), rhel84.NewCentos())
|
||||
distros := distroregistry.NewDefault()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue