-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_windows_virtual_machine
- Support Hotpatch for Windows Server 2025
#28160
azurerm_windows_virtual_machine
- Support Hotpatch for Windows Server 2025
#28160
Conversation
@@ -641,7 +641,7 @@ 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") { | |||
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") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is verging on becoming unreadable and difficult to see at first glance which sku's support hotpatching, can we separate the sku comparisons out into a separate check, something like
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{ | |
// list skus here | |
} | |
hotPatchingSupported := false | |
for _, s := range supportedSkus { | |
if sku == s { | |
hotPatchingSupported = true | |
} | |
} | |
if pub == "MicrosoftWindowsServer" && offer == "WindowsServer" && hotPatchingSupported { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. I found the standard lib already supports it so that I directly leverage it.
Hi @stephybun , thank you for the review. I have updated the code. Kindly help take another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ms-zhenhua LGTM 👍
* Update CHANGELOG.md for #26304 * Update CHANGELOG.md for #28211 * Update for #28016 * Update for #28139 * Update for #27776 * Update for #28227 * Update for #28080 * Update for #28228 * Update for #27915 * reword nginx api upgrade * Update for #28160 * Update for #28043 * run changelog-update-for-release.sh --------- Co-authored-by: stephybun <[email protected]> Co-authored-by: kt <[email protected]>
Community Note
Description
Fix #28141
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
--- PASS: TestAccWindowsVirtualMachine_otherGuestPatchHotpatchingEnabled (392.59s)
PASS
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_windows_virtual_machine
- Support Hotpatch for Windows Server 2025 [Hotpatch support for Windows Server 2025 #28141]This is a (please select all that apply):
Related Issue(s)
Fixes #28141
Note
If this PR changes meaningfully during the course of review please update the title and description as required.