cloudapi/v2: support HyperV generation in Azure upload options

This commit is contained in:
Sanne Raymaekers 2024-11-12 15:29:24 +01:00
parent f672610509
commit 8fd36225be
4 changed files with 223 additions and 188 deletions

View file

@ -189,11 +189,19 @@ func newAzureTarget(options UploadOptions, imageType distro.ImageType) (*target.
if azureUploadOptions.Location != nil {
rgLocation = *azureUploadOptions.Location
}
hypvgen := target.HyperVGenV1
if azureUploadOptions.HyperVGeneration != nil &&
*azureUploadOptions.HyperVGeneration == AzureUploadOptionsHyperVGenerationV2 {
hypvgen = target.HyperVGenV2
}
t := target.NewAzureImageTarget(&target.AzureImageTargetOptions{
TenantID: azureUploadOptions.TenantId,
Location: rgLocation,
SubscriptionID: azureUploadOptions.SubscriptionId,
ResourceGroup: azureUploadOptions.ResourceGroup,
TenantID: azureUploadOptions.TenantId,
Location: rgLocation,
SubscriptionID: azureUploadOptions.SubscriptionId,
ResourceGroup: azureUploadOptions.ResourceGroup,
HyperVGeneration: hypvgen,
})
if azureUploadOptions.ImageName != nil {