osbuild-worker: use the new ostree resolver API
This commit is contained in:
parent
f291f41dbc
commit
64f479092d
27 changed files with 318 additions and 136 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"github.com/osbuild/images/pkg/disk"
|
||||
"github.com/osbuild/images/pkg/distro"
|
||||
"github.com/osbuild/images/pkg/ostree"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
"github.com/osbuild/osbuild-composer/internal/cloud/gcp"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
|
|
@ -56,11 +57,11 @@ func newAWSTarget(options UploadOptions, imageType distro.ImageType) (*target.Ta
|
|||
|
||||
var amiBootMode *string
|
||||
switch imageType.BootMode() {
|
||||
case distro.BOOT_HYBRID:
|
||||
case platform.BOOT_HYBRID:
|
||||
amiBootMode = common.ToPtr(string(ec2types.BootModeValuesUefiPreferred))
|
||||
case distro.BOOT_UEFI:
|
||||
case platform.BOOT_UEFI:
|
||||
amiBootMode = common.ToPtr(string(ec2types.BootModeValuesUefi))
|
||||
case distro.BOOT_LEGACY:
|
||||
case platform.BOOT_LEGACY:
|
||||
amiBootMode = common.ToPtr(string(ec2types.BootModeValuesLegacyBios))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -228,7 +228,12 @@ func (s *Server) enqueueCompose(irs []imageRequest, channel string) (uuid.UUID,
|
|||
workerResolveSpecs := make([]worker.OSTreeResolveSpec, len(sources))
|
||||
for idx, source := range sources {
|
||||
// ostree.SourceSpec is directly convertible to worker.OSTreeResolveSpec
|
||||
workerResolveSpecs[idx] = worker.OSTreeResolveSpec(source)
|
||||
workerResolveSpecs[idx] = worker.OSTreeResolveSpec{
|
||||
URL: source.URL,
|
||||
Ref: source.Ref,
|
||||
RHSM: source.RHSM,
|
||||
}
|
||||
|
||||
}
|
||||
jobID, err := s.workers.EnqueueOSTreeResolveJob(&worker.OSTreeResolveJob{Specs: workerResolveSpecs}, channel)
|
||||
if err != nil {
|
||||
|
|
@ -356,7 +361,11 @@ func (s *Server) enqueueKojiCompose(taskID uint64, server, name, version, releas
|
|||
workerResolveSpecs := make([]worker.OSTreeResolveSpec, len(sources))
|
||||
for idx, source := range sources {
|
||||
// ostree.SourceSpec is directly convertible to worker.OSTreeResolveSpec
|
||||
workerResolveSpecs[idx] = worker.OSTreeResolveSpec(source)
|
||||
workerResolveSpecs[idx] = worker.OSTreeResolveSpec{
|
||||
URL: source.URL,
|
||||
Ref: source.Ref,
|
||||
RHSM: source.RHSM,
|
||||
}
|
||||
}
|
||||
jobID, err := s.workers.EnqueueOSTreeResolveJob(&worker.OSTreeResolveJob{Specs: workerResolveSpecs}, channel)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -2393,6 +2393,7 @@ func (api *API) resolveOSTreeCommits(sourceSpecs map[string][]ostree.SourceSpec,
|
|||
Checksum: checksum,
|
||||
}
|
||||
} else {
|
||||
// MTLS not supported on-prem
|
||||
commit, err := ostree.Resolve(source)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
|
||||
"github.com/osbuild/images/pkg/distro"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/osbuild-composer/internal/cloud/gcp"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
|
@ -283,11 +284,11 @@ func uploadRequestToTarget(u uploadRequest, imageType distro.ImageType) *target.
|
|||
|
||||
var amiBootMode *string
|
||||
switch imageType.BootMode() {
|
||||
case distro.BOOT_HYBRID:
|
||||
case platform.BOOT_HYBRID:
|
||||
amiBootMode = common.ToPtr(string(ec2types.BootModeValuesUefiPreferred))
|
||||
case distro.BOOT_UEFI:
|
||||
case platform.BOOT_UEFI:
|
||||
amiBootMode = common.ToPtr(string(ec2types.BootModeValuesUefi))
|
||||
case distro.BOOT_LEGACY:
|
||||
case platform.BOOT_LEGACY:
|
||||
amiBootMode = common.ToPtr(string(ec2types.BootModeValuesLegacyBios))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue