-
Notifications
You must be signed in to change notification settings - Fork 73
WINC-1869: Drop support for Windows Server 2019 in CI and machineset.sh script #3995
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,7 +7,7 @@ | |||||||||||||||||
| # machineset.sh | ||||||||||||||||||
| # OPTIONS | ||||||||||||||||||
| # -b Set 'windowsmachineconfig.openshift.io/ignore' label for BYOH use case. Default: false | ||||||||||||||||||
| # -w Windows Server version (optional) 2019 or 2022. Default: 2022 | ||||||||||||||||||
| # -w Windows Server version (optional) 2022 or 2025. Default: 2022 | ||||||||||||||||||
| # $1/$2 (if -w is used) Action (optional) apply/delete the MachineSet | ||||||||||||||||||
| # PREREQUISITES | ||||||||||||||||||
| # oc to fetch cluster info and apply/delete MachineSets on the cluster(cluster should be logged in) | ||||||||||||||||||
|
|
@@ -87,9 +87,6 @@ get_aws_ms() { | |||||||||||||||||
| # check Windows version and set AMI filter | ||||||||||||||||||
| filter="" | ||||||||||||||||||
| case "$winver" in | ||||||||||||||||||
| "2019") | ||||||||||||||||||
| filter="Windows_Server-2019-English-Core-Base-????.??.??" | ||||||||||||||||||
| ;; | ||||||||||||||||||
| "2025") | ||||||||||||||||||
| filter="Windows_Server-2025-English-Core-Base-????.??.??" | ||||||||||||||||||
| ;; | ||||||||||||||||||
|
|
@@ -167,11 +164,6 @@ get_azure_ms() { | |||||||||||||||||
| local sku="" | ||||||||||||||||||
| local release="latest" | ||||||||||||||||||
| case "$winver" in | ||||||||||||||||||
| "2019") | ||||||||||||||||||
| sku="2019-datacenter-smalldisk" | ||||||||||||||||||
| # TODO: remove when VM SSH issue is patched in Azure cloud | ||||||||||||||||||
| release="17763.6293.240905" | ||||||||||||||||||
| ;; | ||||||||||||||||||
| "2025") | ||||||||||||||||||
| sku="2025-datacenter-smalldisk" | ||||||||||||||||||
| ;; | ||||||||||||||||||
|
|
@@ -239,9 +231,6 @@ get_gcp_ms() { | |||||||||||||||||
| # check Windows version and set image family | ||||||||||||||||||
| local image="" | ||||||||||||||||||
| case "$winver" in | ||||||||||||||||||
| "2019") | ||||||||||||||||||
| image="projects/windows-cloud/global/images/family/windows-2019-core" | ||||||||||||||||||
| ;; | ||||||||||||||||||
| "2025") | ||||||||||||||||||
| image="projects/windows-cloud/global/images/family/windows-2025-core" | ||||||||||||||||||
| ;; | ||||||||||||||||||
|
|
@@ -306,9 +295,6 @@ get_vsphere_ms() { | |||||||||||||||||
|
|
||||||||||||||||||
| # set golden image template name based on Windows Server version | ||||||||||||||||||
| case "$winver" in | ||||||||||||||||||
| "2019") | ||||||||||||||||||
| error-exit "No template available for Windows Server 2019 in DevQE vCenter" | ||||||||||||||||||
| ;; | ||||||||||||||||||
| "2025") | ||||||||||||||||||
| template="windows-golden-images/windows-server-2025-template-ipv6-disabled" | ||||||||||||||||||
| ;; | ||||||||||||||||||
|
|
@@ -430,18 +416,18 @@ winver="2022" | |||||||||||||||||
| byoh=false | ||||||||||||||||||
| while getopts ":w:b" opt; do | ||||||||||||||||||
| case ${opt} in | ||||||||||||||||||
| w ) # Windows Server version to use in the MachineSet. Defaults to 2022. Other option is 2019. | ||||||||||||||||||
| w ) # Windows Server version to use in the MachineSet. Defaults to 2022. Other option is 2025. | ||||||||||||||||||
| winver="$OPTARG" | ||||||||||||||||||
| if [[ ! "$winver" =~ 2019|2022|2025$ ]]; then | ||||||||||||||||||
| echo "Invalid -w option $winver. Valid options are 2019, 2022 or 2025" | ||||||||||||||||||
| if [[ ! "$winver" =~ 2022|2025$ ]]; then | ||||||||||||||||||
| echo "Invalid -w option $winver. Valid options are 2022 or 2025" | ||||||||||||||||||
| exit 1 | ||||||||||||||||||
| fi | ||||||||||||||||||
| ;; | ||||||||||||||||||
| b ) | ||||||||||||||||||
| byoh=true | ||||||||||||||||||
| ;; | ||||||||||||||||||
| \? ) | ||||||||||||||||||
| echo "Usage: $0 -w <2019/2022> -b apply/delete" | ||||||||||||||||||
| echo "Usage: $0 -w <2022/2025> -b apply/delete" | ||||||||||||||||||
| exit 0 | ||||||||||||||||||
|
Comment on lines
429
to
431
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Static verification of the invalid-option branch behavior.
rg -n -C2 '\\\? \)|Usage: .*2022/2025|exit 0|exit 1' hack/machineset.shRepository: openshift/windows-machine-config-operator Length of output: 405 Return non-zero exit code for invalid CLI option usage. Line 431 exits with Proposed fix \? )
echo "Usage: $0 -w <2022/2025> -b apply/delete"
- exit 0
+ exit 1
;;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not related There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||
| ;; | ||||||||||||||||||
| esac | ||||||||||||||||||
|
|
||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/windows-machine-config-operator
Length of output: 216
🏁 Script executed:
sed -n '410,435p' hack/machineset.shRepository: openshift/windows-machine-config-operator
Length of output: 621
Fix
-wregex anchoring to reject malformed Windows versions.Line 421 uses
2022|2025$, which accepts partial matches likeabc2022and20220. Fully anchor the alternation to ensure only exact matches for valid Windows Server versions.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
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.
not related
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.
@jrvaldes, understood — the regex anchoring concern is pre-existing and not related to the 2019 removal in scope here. Would you like me to open a follow-up GitHub issue to track the fix (^(2022|2025)$) so it doesn't get lost?