internal/weldr: adapt to aws sdk v2

This commit is contained in:
Sanne Raymaekers 2024-08-02 14:17:01 +02:00
parent c87cbe0cbc
commit 8b0e09ed20
2 changed files with 6 additions and 6 deletions

View file

@ -17,7 +17,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/aws/aws-sdk-go/service/ec2" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/osbuild/images/pkg/container" "github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/distro" "github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/distro/test_distro" "github.com/osbuild/images/pkg/distro/test_distro"
@ -1086,7 +1086,7 @@ func TestCompose(t *testing.T) {
SecretAccessKey: "secretkey", SecretAccessKey: "secretkey",
Bucket: "clay", Bucket: "clay",
Key: "imagekey", Key: "imagekey",
BootMode: common.ToPtr(ec2.BootModeValuesUefiPreferred), BootMode: common.ToPtr(string(ec2types.BootModeValuesUefiPreferred)),
}, },
}, },
}, },

View file

@ -8,7 +8,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/aws/aws-sdk-go/service/ec2" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/osbuild/images/pkg/distro" "github.com/osbuild/images/pkg/distro"
"github.com/osbuild/osbuild-composer/internal/common" "github.com/osbuild/osbuild-composer/internal/common"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
@ -283,11 +283,11 @@ func uploadRequestToTarget(u uploadRequest, imageType distro.ImageType) *target.
var amiBootMode *string var amiBootMode *string
switch imageType.BootMode() { switch imageType.BootMode() {
case distro.BOOT_HYBRID: case distro.BOOT_HYBRID:
amiBootMode = common.ToPtr(ec2.BootModeValuesUefiPreferred) amiBootMode = common.ToPtr(string(ec2types.BootModeValuesUefiPreferred))
case distro.BOOT_UEFI: case distro.BOOT_UEFI:
amiBootMode = common.ToPtr(ec2.BootModeValuesUefi) amiBootMode = common.ToPtr(string(ec2types.BootModeValuesUefi))
case distro.BOOT_LEGACY: case distro.BOOT_LEGACY:
amiBootMode = common.ToPtr(ec2.BootModeValuesLegacyBios) amiBootMode = common.ToPtr(string(ec2types.BootModeValuesLegacyBios))
} }
t.Options = &target.AWSTargetOptions{ t.Options = &target.AWSTargetOptions{