diff --git a/internal/jobqueue/api_test.go b/internal/jobqueue/api_test.go index b04b61c46..535369028 100644 --- a/internal/jobqueue/api_test.go +++ b/internal/jobqueue/api_test.go @@ -45,7 +45,7 @@ func TestCreate(t *testing.T) { store := store.New(nil, distro) api := jobqueue.New(nil, store) - err := store.PushCompose(id, &blueprint.Blueprint{}, map[string]string{"test-repo": "test:foo"}, "test_arch", "test_output", nil) + err := store.PushCompose(id, &blueprint.Blueprint{}, map[string]string{"test-repo": "test:foo"}, "test_arch", "test_output", 0, nil) if err != nil { t.Fatalf("error pushing compose: %v", err) } @@ -61,7 +61,7 @@ func testUpdateTransition(t *testing.T, from, to string, expectedStatus int) { api := jobqueue.New(nil, store) if from != "VOID" { - err := store.PushCompose(id, &blueprint.Blueprint{}, map[string]string{"test": "test:foo"}, "test_arch", "test_output", nil) + err := store.PushCompose(id, &blueprint.Blueprint{}, map[string]string{"test": "test:foo"}, "test_arch", "test_output", 0, nil) if err != nil { t.Fatalf("error pushing compose: %v", err) } diff --git a/internal/rcm/api.go b/internal/rcm/api.go index 3ca9cc6b4..2cf4d11a1 100644 --- a/internal/rcm/api.go +++ b/internal/rcm/api.go @@ -129,7 +129,7 @@ func (api *API) submit(writer http.ResponseWriter, request *http.Request, _ http // Push the requested compose to the store composeUUID := uuid.New() // nil is used as an upload target, because LocalTarget is already used in the PushCompose function - err = api.store.PushCompose(composeUUID, &blueprint.Blueprint{}, make(map[string]string), composeRequest.Architectures[0], composeRequest.ImageTypes[0], nil) + err = api.store.PushCompose(composeUUID, &blueprint.Blueprint{}, make(map[string]string), composeRequest.Architectures[0], composeRequest.ImageTypes[0], 0, nil) if err != nil { if api.logger != nil { api.logger.Println("RCM API failed to push compose:", err) diff --git a/internal/store/store.go b/internal/store/store.go index 2433d4bc2..a574d7959 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -443,7 +443,7 @@ func (s *Store) GetComposeResult(id uuid.UUID) (io.ReadCloser, error) { return os.Open(*s.stateDir + "/outputs/" + id.String() + "/result.json") } -func (s *Store) PushCompose(composeID uuid.UUID, bp *blueprint.Blueprint, checksums map[string]string, arch, composeType string, uploadTarget *target.Target) error { +func (s *Store) PushCompose(composeID uuid.UUID, bp *blueprint.Blueprint, checksums map[string]string, arch, composeType string, size uint64, uploadTarget *target.Target) error { targets := []*target.Target{} if s.stateDir != nil { @@ -463,7 +463,7 @@ func (s *Store) PushCompose(composeID uuid.UUID, bp *blueprint.Blueprint, checks repos = append(repos, source.RepoConfig()) } - pipeline, err := s.distro.Pipeline(bp, repos, checksums, arch, composeType, 0) + pipeline, err := s.distro.Pipeline(bp, repos, checksums, arch, composeType, size) if err != nil { return err } diff --git a/internal/weldr/api.go b/internal/weldr/api.go index e587ecc40..35d71336e 100644 --- a/internal/weldr/api.go +++ b/internal/weldr/api.go @@ -1257,7 +1257,7 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request return } - err = api.store.PushCompose(reply.BuildID, bp, checksums, api.arch, cr.ComposeType, uploadTarget) + err = api.store.PushCompose(reply.BuildID, bp, checksums, api.arch, cr.ComposeType, 0, uploadTarget) // TODO: we should probably do some kind of blueprint validation in future // for now, let's just 500 and bail out