Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-zhenhua committed Dec 12, 2024
1 parent e0c94c3 commit bf69a55
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion internal/services/compute/shared_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package compute

import (
"slices"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
Expand Down Expand Up @@ -641,7 +643,18 @@ func isValidHotPatchSourceImageReference(referenceInput []interface{}, imageId s
offer := raw["offer"].(string)
sku := raw["sku"].(string)

if pub == "MicrosoftWindowsServer" && offer == "WindowsServer" && (sku == "2022-datacenter-azure-edition-core" || sku == "2022-datacenter-azure-edition-core-smalldisk" || sku == "2022-datacenter-azure-edition-hotpatch" || sku == "2022-datacenter-azure-edition-hotpatch-smalldisk" || sku == "2025-datacenter-azure-edition" || sku == "2025-datacenter-azure-edition-smalldisk" || sku == "2025-datacenter-azure-edition-core" || sku == "2025-datacenter-azure-edition-core-smalldisk") {
supportedSkus := []string{
"2022-datacenter-azure-edition-core",
"2022-datacenter-azure-edition-core-smalldisk",
"2022-datacenter-azure-edition-hotpatch",
"2022-datacenter-azure-edition-hotpatch-smalldisk",
"2025-datacenter-azure-edition",
"2025-datacenter-azure-edition-smalldisk",
"2025-datacenter-azure-edition-core",
"2025-datacenter-azure-edition-core-smalldisk",
}

if pub == "MicrosoftWindowsServer" && offer == "WindowsServer" && slices.Contains(supportedSkus, sku) {
return true
}

Expand Down

0 comments on commit bf69a55

Please sign in to comment.