distro: move Registry to its own distroregistry package
My goal is to add a method to distroregistry to return Registry with all supported distributions. This way, all supported distributions would be defined only on one place. To achieve this, the Registry must live outside the distro package because the distro implementation depends on it and this would create a circular dependency unsupported by Go. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
b5a1d89e45
commit
dd4db353e2
10 changed files with 109 additions and 86 deletions
|
|
@ -1,14 +1,14 @@
|
|||
package distro_mock
|
||||
|
||||
import (
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro/fedoratest"
|
||||
"github.com/osbuild/osbuild-composer/internal/distroregistry"
|
||||
)
|
||||
|
||||
func NewDefaultRegistry() (*distro.Registry, error) {
|
||||
func NewDefaultRegistry() (*distroregistry.Registry, error) {
|
||||
ftest := fedoratest.New()
|
||||
if ftest == nil {
|
||||
panic("Attempt to register Fedora test failed")
|
||||
}
|
||||
return distro.NewRegistry(ftest)
|
||||
return distroregistry.New(ftest)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue