store: drop the distro registry
This was now unused. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
0656fdcd38
commit
1345ca77fd
5 changed files with 16 additions and 34 deletions
|
|
@ -104,7 +104,7 @@ func main() {
|
|||
logger = log.New(os.Stdout, "", 0)
|
||||
}
|
||||
|
||||
store := store.New(&stateDir, *distros)
|
||||
store := store.New(&stateDir)
|
||||
|
||||
jobAPI := jobqueue.New(logger, store)
|
||||
weldrAPI := weldr.New(rpm, common.CurrentArch(), distribution, repoMap[common.CurrentArch()], logger, store)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import (
|
|||
"net/http"
|
||||
"testing"
|
||||
|
||||
distro_mock "github.com/osbuild/osbuild-composer/internal/mocks/distro"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
test_distro "github.com/osbuild/osbuild-composer/internal/distro/fedoratest"
|
||||
"github.com/osbuild/osbuild-composer/internal/jobqueue"
|
||||
|
|
@ -34,11 +32,7 @@ func TestBasic(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, c := range cases {
|
||||
registry, err := distro_mock.NewDefaultRegistry()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
api := jobqueue.New(nil, store.New(nil, *registry))
|
||||
api := jobqueue.New(nil, store.New(nil))
|
||||
|
||||
test.TestNonJsonRoute(t, api, false, c.Method, c.Path, c.Body, c.ExpectedStatus, c.ExpectedResponse)
|
||||
}
|
||||
|
|
@ -47,14 +41,10 @@ func TestBasic(t *testing.T) {
|
|||
func TestCreate(t *testing.T) {
|
||||
id, _ := uuid.Parse("ffffffff-ffff-ffff-ffff-ffffffffffff")
|
||||
distroStruct := test_distro.New()
|
||||
registry, err := distro_mock.NewDefaultRegistry()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
store := store.New(nil, *registry)
|
||||
store := store.New(nil)
|
||||
api := jobqueue.New(nil, store)
|
||||
|
||||
err = store.PushCompose(distroStruct, id, &blueprint.Blueprint{}, nil, nil, nil, "x86_64", "qcow2", 0, nil)
|
||||
err := store.PushCompose(distroStruct, id, &blueprint.Blueprint{}, nil, nil, nil, "x86_64", "qcow2", 0, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("error pushing compose: %v", err)
|
||||
}
|
||||
|
|
@ -66,11 +56,7 @@ func TestCreate(t *testing.T) {
|
|||
func testUpdateTransition(t *testing.T, from, to string, expectedStatus int, expectedResponse string) {
|
||||
id, _ := uuid.Parse("ffffffff-ffff-ffff-ffff-ffffffffffff")
|
||||
distroStruct := test_distro.New()
|
||||
registry, err := distro_mock.NewDefaultRegistry()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
store := store.New(nil, *registry)
|
||||
store := store.New(nil)
|
||||
api := jobqueue.New(nil, store)
|
||||
|
||||
if from != "VOID" {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import (
|
|||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/compose"
|
||||
distro_mock "github.com/osbuild/osbuild-composer/internal/mocks/distro"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
|
|
@ -93,8 +92,7 @@ func createBaseStoreFixture() *store.Store {
|
|||
},
|
||||
}
|
||||
|
||||
r, _ := distro_mock.NewDefaultRegistry()
|
||||
s := store.New(nil, *r)
|
||||
s := store.New(nil)
|
||||
|
||||
s.Blueprints[bName] = b
|
||||
s.Composes = map[uuid.UUID]compose.Compose{
|
||||
|
|
@ -189,8 +187,7 @@ func createStoreWithoutComposesFixture() *store.Store {
|
|||
Customizations: nil,
|
||||
}
|
||||
|
||||
r, _ := distro_mock.NewDefaultRegistry()
|
||||
s := store.New(nil, *r)
|
||||
s := store.New(nil)
|
||||
|
||||
s.Blueprints[bName] = b
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ package rcm_test
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"github.com/google/uuid"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
distro_mock "github.com/osbuild/osbuild-composer/internal/mocks/distro"
|
||||
rpmmd_mock "github.com/osbuild/osbuild-composer/internal/mocks/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/rcm"
|
||||
|
|
@ -52,7 +53,7 @@ func TestBasicRcmAPI(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
api := rcm.New(nil, store.New(nil, *registry), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()), registry)
|
||||
api := rcm.New(nil, store.New(nil), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()), registry)
|
||||
|
||||
for _, c := range cases {
|
||||
resp := internalRequest(api, c.Method, c.Path, c.Body, c.ContentType)
|
||||
|
|
@ -78,7 +79,7 @@ func TestSubmitCompose(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
api := rcm.New(nil, store.New(nil, *registry), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()), registry)
|
||||
api := rcm.New(nil, store.New(nil), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()), registry)
|
||||
|
||||
var submit_reply struct {
|
||||
UUID uuid.UUID `json:"compose_id"`
|
||||
|
|
|
|||
|
|
@ -42,11 +42,10 @@ type Store struct {
|
|||
BlueprintsChanges map[string]map[string]blueprint.Change `json:"changes"`
|
||||
BlueprintsCommits map[string][]string `json:"commits"`
|
||||
|
||||
mu sync.RWMutex // protects all fields
|
||||
pendingJobs chan Job
|
||||
stateChannel chan []byte
|
||||
distroRegistry distro.Registry
|
||||
stateDir *string
|
||||
mu sync.RWMutex // protects all fields
|
||||
pendingJobs chan Job
|
||||
stateChannel chan []byte
|
||||
stateDir *string
|
||||
}
|
||||
|
||||
// A Job contains the information about a compose a worker needs to process it.
|
||||
|
|
@ -107,7 +106,7 @@ func (e *NoLocalTargetError) Error() string {
|
|||
return e.message
|
||||
}
|
||||
|
||||
func New(stateDir *string, distroRegistryArg distro.Registry) *Store {
|
||||
func New(stateDir *string) *Store {
|
||||
var s Store
|
||||
|
||||
if stateDir != nil {
|
||||
|
|
@ -141,7 +140,6 @@ func New(stateDir *string, distroRegistryArg distro.Registry) *Store {
|
|||
}
|
||||
|
||||
s.pendingJobs = make(chan Job, 200)
|
||||
s.distroRegistry = distroRegistryArg
|
||||
s.stateDir = stateDir
|
||||
|
||||
if s.Blueprints == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue