diff --git a/internal/cloudapi/v2/compose_test.go b/internal/cloudapi/v2/compose_test.go index f7f8dc7b78..bdb8ce1a8b 100644 --- a/internal/cloudapi/v2/compose_test.go +++ b/internal/cloudapi/v2/compose_test.go @@ -1,8 +1,10 @@ package v2 import ( + "io/fs" "testing" + "github.com/osbuild/images/data/repositories" "github.com/osbuild/images/pkg/customizations/subscription" "github.com/osbuild/images/pkg/disk" "github.com/osbuild/images/pkg/distrofactory" @@ -811,9 +813,9 @@ func TestGetImageRequests_NoRepositories(t *testing.T) { Repositories: []Repository{}, }, } - // NOTE: current directory is the location of this file, back up so it can use ./repositories/ - rr, err := reporegistry.New([]string{"../../../"}) + reposConf, err := reporegistry.LoadAllRepositoriesFromFS([]fs.FS{repos.FS}) require.NoError(t, err) + rr := reporegistry.NewFromDistrosRepoConfigs(reposConf) got, err := request.GetImageRequests(distrofactory.NewDefault(), rr) assert.NoError(t, err) require.Len(t, got, 1) @@ -837,9 +839,9 @@ func TestGetImageRequests_BlueprintDistro(t *testing.T) { Distro: common.ToPtr("fedora-39"), }, } - // NOTE: current directory is the location of this file, back up so it can use ./repositories/ - rr, err := reporegistry.New([]string{"../../../"}) + reposConf, err := reporegistry.LoadAllRepositoriesFromFS([]fs.FS{repos.FS}) require.NoError(t, err) + rr := reporegistry.NewFromDistrosRepoConfigs(reposConf) got, err := request.GetImageRequests(distrofactory.NewDefault(), rr) assert.NoError(t, err) require.Len(t, got, 1) diff --git a/osbuild-composer.spec b/osbuild-composer.spec index f440ac653b..61f0ae1afb 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -164,7 +164,8 @@ install -m 0644 -vp vendor/github.com/osbuild/images/data/repositories/centos-* %else # All other CentOS versions support building for the same version install -m 0644 -vp vendor/github.com/osbuild/images/data/repositories/centos-%{centos}* %{buildroot}%{_datadir}/osbuild-composer/repositories/ -install -m 0644 -vp vendor/github.com/osbuild/images/data/repositories/centos-stream-%{centos}* %{buildroot}%{_datadir}/osbuild-composer/repositories/ +# centos-stream-* are symlinks +cp -a repositories/centos-stream-%{centos}* %{buildroot}%{_datadir}/osbuild-composer/repositories/ %endif %else