clouadpi: remove distribution from enqueue methods
They can just find it from the image type. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
c48bf0a143
commit
ab8c1ae4f7
2 changed files with 8 additions and 7 deletions
|
|
@ -273,12 +273,12 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
|
||||||
|
|
||||||
var id uuid.UUID
|
var id uuid.UUID
|
||||||
if request.Koji != nil {
|
if request.Koji != nil {
|
||||||
id, err = h.server.enqueueKojiCompose(uint64(request.Koji.TaskId), request.Koji.Server, request.Koji.Name, request.Koji.Version, request.Koji.Release, distribution, bp, manifestSeed, irs, channel)
|
id, err = h.server.enqueueKojiCompose(uint64(request.Koji.TaskId), request.Koji.Server, request.Koji.Name, request.Koji.Version, request.Koji.Release, bp, manifestSeed, irs, channel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
id, err = h.server.enqueueCompose(distribution, bp, manifestSeed, irs, channel)
|
id, err = h.server.enqueueCompose(bp, manifestSeed, irs, channel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/pkg/jobqueue"
|
"github.com/osbuild/osbuild-composer/pkg/jobqueue"
|
||||||
|
|
||||||
"github.com/osbuild/images/pkg/container"
|
"github.com/osbuild/images/pkg/container"
|
||||||
"github.com/osbuild/images/pkg/distro"
|
|
||||||
"github.com/osbuild/images/pkg/distrofactory"
|
"github.com/osbuild/images/pkg/distrofactory"
|
||||||
"github.com/osbuild/images/pkg/manifest"
|
"github.com/osbuild/images/pkg/manifest"
|
||||||
"github.com/osbuild/images/pkg/ostree"
|
"github.com/osbuild/images/pkg/ostree"
|
||||||
|
|
@ -118,7 +117,7 @@ func (s *Server) Shutdown() {
|
||||||
s.goroutinesGroup.Wait()
|
s.goroutinesGroup.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) enqueueCompose(distribution distro.Distro, bp blueprint.Blueprint, manifestSeed int64, irs []imageRequest, channel string) (uuid.UUID, error) {
|
func (s *Server) enqueueCompose(bp blueprint.Blueprint, manifestSeed int64, irs []imageRequest, channel string) (uuid.UUID, error) {
|
||||||
var id uuid.UUID
|
var id uuid.UUID
|
||||||
if len(irs) != 1 {
|
if len(irs) != 1 {
|
||||||
return id, HTTPError(ErrorInvalidNumberOfImageBuilds)
|
return id, HTTPError(ErrorInvalidNumberOfImageBuilds)
|
||||||
|
|
@ -126,8 +125,9 @@ func (s *Server) enqueueCompose(distribution distro.Distro, bp blueprint.Bluepri
|
||||||
ir := irs[0]
|
ir := irs[0]
|
||||||
|
|
||||||
ibp := blueprint.Convert(bp)
|
ibp := blueprint.Convert(bp)
|
||||||
// shortcut
|
// shortcuts
|
||||||
arch := ir.imageType.Arch()
|
arch := ir.imageType.Arch()
|
||||||
|
distribution := arch.Distro()
|
||||||
|
|
||||||
manifestSource, _, err := ir.imageType.Manifest(&ibp, ir.imageOptions, ir.repositories, manifestSeed)
|
manifestSource, _, err := ir.imageType.Manifest(&ibp, ir.imageOptions, ir.repositories, manifestSeed)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -233,7 +233,7 @@ func (s *Server) enqueueCompose(distribution distro.Distro, bp blueprint.Bluepri
|
||||||
return id, nil
|
return id, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) enqueueKojiCompose(taskID uint64, server, name, version, release string, distribution distro.Distro, bp blueprint.Blueprint, manifestSeed int64, irs []imageRequest, channel string) (uuid.UUID, error) {
|
func (s *Server) enqueueKojiCompose(taskID uint64, server, name, version, release string, bp blueprint.Blueprint, manifestSeed int64, irs []imageRequest, channel string) (uuid.UUID, error) {
|
||||||
var id uuid.UUID
|
var id uuid.UUID
|
||||||
kojiDirectory := "osbuild-cg/osbuild-composer-koji-" + uuid.New().String()
|
kojiDirectory := "osbuild-cg/osbuild-composer-koji-" + uuid.New().String()
|
||||||
|
|
||||||
|
|
@ -252,8 +252,9 @@ func (s *Server) enqueueKojiCompose(taskID uint64, server, name, version, releas
|
||||||
for _, ir := range irs {
|
for _, ir := range irs {
|
||||||
ibp := blueprint.Convert(bp)
|
ibp := blueprint.Convert(bp)
|
||||||
|
|
||||||
// shortcut
|
// shortcuts
|
||||||
arch := ir.imageType.Arch()
|
arch := ir.imageType.Arch()
|
||||||
|
distribution := arch.Distro()
|
||||||
|
|
||||||
manifestSource, _, err := ir.imageType.Manifest(&ibp, ir.imageOptions, ir.repositories, manifestSeed)
|
manifestSource, _, err := ir.imageType.Manifest(&ibp, ir.imageOptions, ir.repositories, manifestSeed)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue