fix: add --dns-zone-rg-name to Azure self-managed destroy step - #78516
Conversation
openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. The destroy-management-cluster step in the self-managed workflow was not passing it, causing every e2e-azure-self-managed run to fail during cleanup and leak Azure clusters. The create step already passes --dns-zone-rg-name=os4-common; this adds the same flag to the destroy step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WalkthroughAdded DNS resource group configuration to HyperShift Azure destroy chains so the Azure destroy command includes a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 12✅ Passed checks (12 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/pj-rehearse pull-ci-openshift-hypershift-main-e2e-azure-self-managed |
|
@bryan-cox: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
/pj-rehearse pull-ci-openshift-hypershift-main-e2e-azure-self-managed |
|
@bryan-cox: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. Two destroy chains were not passing it, causing every Azure HyperShift job to fail during cleanup and leak Azure clusters. hypershift-destroy-nested-management-cluster: used by e2e-azure-self-managed jobs. The create step already passes --dns-zone-rg-name=os4-common; adds the same to the destroy step. hypershift-azure-destroy: used by AKS conformance and 12+ cucushift Azure HyperShift workflows. Adds DNS_ZONE_RG_NAME env var (default os4-common) matching the create chain, and passes it to the destroy command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/pj-rehearse pull-ci-openshift-hypershift-main-e2e-azure-self-managed |
|
@bryan-cox: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
[REHEARSALNOTIFIER]
A total of 472 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs. A full list of affected jobs can be found here Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ci-operator/step-registry/hypershift/azure/destroy/hypershift-azure-destroy-chain.yaml (1)
45-55:⚠️ Potential issue | 🟠 MajorRemove
evaland quote all command arguments (lines 40–54).The COMMAND array is built with unquoted variable expansions (
$CLI,${AZURE_CREDS},${CLUSTER_NAME},${HC_LOCATION},${DNS_ZONE_RG_NAME}) and executed viaeval, which is unsafe. Unquoted expansions can cause word-splitting and enable command injection ifDNS_ZONE_RG_NAMEor other environment variables are controlled. Execute the array directly and quote all arguments.Suggested hardening diff
- COMMAND=( - $CLI destroy cluster azure \ - --azure-creds=${AZURE_CREDS} \ - --name ${CLUSTER_NAME} \ - --location ${HC_LOCATION} \ - --dns-zone-rg-name=${DNS_ZONE_RG_NAME} \ - --cluster-grace-period 40m - ) + COMMAND=( + "$CLI" destroy cluster azure + "--azure-creds=${AZURE_CREDS}" + "--name=${CLUSTER_NAME}" + "--location=${HC_LOCATION}" + "--dns-zone-rg-name=${DNS_ZONE_RG_NAME}" + "--cluster-grace-period=40m" + ) @@ - COMMAND+=(--resource-group-name "$(<"${SHARED_DIR}/resourcegroup")") + COMMAND+=("--resource-group-name" "$(<"${SHARED_DIR}/resourcegroup")") @@ - eval "${COMMAND[@]}" + "${COMMAND[@]}"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci-operator/step-registry/hypershift/azure/destroy/hypershift-azure-destroy-chain.yaml` around lines 45 - 55, The COMMAND array is being executed via eval with unquoted variable expansions which risks word-splitting and injection; stop using eval and run the array directly, and ensure each variable is added as its own quoted argument. Change any appends like COMMAND+=(--dns-zone-rg-name=${DNS_ZONE_RG_NAME}) to COMMAND+=(--dns-zone-rg-name "${DNS_ZONE_RG_NAME}") and the conditional to COMMAND+=(--resource-group-name "$( < "${SHARED_DIR}/resourcegroup" )"), then replace eval "${COMMAND[@]}" with a direct exec "${COMMAND[@]}" so the shell preserves argument boundaries.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In
`@ci-operator/step-registry/hypershift/azure/destroy/hypershift-azure-destroy-chain.yaml`:
- Around line 45-55: The COMMAND array is being executed via eval with unquoted
variable expansions which risks word-splitting and injection; stop using eval
and run the array directly, and ensure each variable is added as its own quoted
argument. Change any appends like
COMMAND+=(--dns-zone-rg-name=${DNS_ZONE_RG_NAME}) to
COMMAND+=(--dns-zone-rg-name "${DNS_ZONE_RG_NAME}") and the conditional to
COMMAND+=(--resource-group-name "$( < "${SHARED_DIR}/resourcegroup" )"), then
replace eval "${COMMAND[@]}" with a direct exec "${COMMAND[@]}" so the shell
preserves argument boundaries.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: c0c73d3c-e058-4e68-a898-128368e3a7c7
📒 Files selected for processing (1)
ci-operator/step-registry/hypershift/azure/destroy/hypershift-azure-destroy-chain.yaml
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox, csrwng The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@bryan-cox: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/pj-rehearse ack This fixed the issue with deleting azure self managed clusters so merging that for now. I will take a look at why the create cluster failed in more detail outside of here. |
|
@bryan-cox: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
fa2a5f5
into
openshift:main
…hift#78516) * fix: add --dns-zone-rg-name to Azure self-managed destroy step openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. The destroy-management-cluster step in the self-managed workflow was not passing it, causing every e2e-azure-self-managed run to fail during cleanup and leak Azure clusters. The create step already passes --dns-zone-rg-name=os4-common; this adds the same flag to the destroy step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add --dns-zone-rg-name to Azure destroy steps openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. Two destroy chains were not passing it, causing every Azure HyperShift job to fail during cleanup and leak Azure clusters. hypershift-destroy-nested-management-cluster: used by e2e-azure-self-managed jobs. The create step already passes --dns-zone-rg-name=os4-common; adds the same to the destroy step. hypershift-azure-destroy: used by AKS conformance and 12+ cucushift Azure HyperShift workflows. Adds DNS_ZONE_RG_NAME env var (default os4-common) matching the create chain, and passes it to the destroy command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…hift#78516) * fix: add --dns-zone-rg-name to Azure self-managed destroy step openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. The destroy-management-cluster step in the self-managed workflow was not passing it, causing every e2e-azure-self-managed run to fail during cleanup and leak Azure clusters. The create step already passes --dns-zone-rg-name=os4-common; this adds the same flag to the destroy step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add --dns-zone-rg-name to Azure destroy steps openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. Two destroy chains were not passing it, causing every Azure HyperShift job to fail during cleanup and leak Azure clusters. hypershift-destroy-nested-management-cluster: used by e2e-azure-self-managed jobs. The create step already passes --dns-zone-rg-name=os4-common; adds the same to the destroy step. hypershift-azure-destroy: used by AKS conformance and 12+ cucushift Azure HyperShift workflows. Adds DNS_ZONE_RG_NAME env var (default os4-common) matching the create chain, and passes it to the destroy command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…hift#78516) * fix: add --dns-zone-rg-name to Azure self-managed destroy step openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. The destroy-management-cluster step in the self-managed workflow was not passing it, causing every e2e-azure-self-managed run to fail during cleanup and leak Azure clusters. The create step already passes --dns-zone-rg-name=os4-common; this adds the same flag to the destroy step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add --dns-zone-rg-name to Azure destroy steps openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. Two destroy chains were not passing it, causing every Azure HyperShift job to fail during cleanup and leak Azure clusters. hypershift-destroy-nested-management-cluster: used by e2e-azure-self-managed jobs. The create step already passes --dns-zone-rg-name=os4-common; adds the same to the destroy step. hypershift-azure-destroy: used by AKS conformance and 12+ cucushift Azure HyperShift workflows. Adds DNS_ZONE_RG_NAME env var (default os4-common) matching the create chain, and passes it to the destroy command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…hift#78516) * fix: add --dns-zone-rg-name to Azure self-managed destroy step openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. The destroy-management-cluster step in the self-managed workflow was not passing it, causing every e2e-azure-self-managed run to fail during cleanup and leak Azure clusters. The create step already passes --dns-zone-rg-name=os4-common; this adds the same flag to the destroy step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add --dns-zone-rg-name to Azure destroy steps openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. Two destroy chains were not passing it, causing every Azure HyperShift job to fail during cleanup and leak Azure clusters. hypershift-destroy-nested-management-cluster: used by e2e-azure-self-managed jobs. The create step already passes --dns-zone-rg-name=os4-common; adds the same to the destroy step. hypershift-azure-destroy: used by AKS conformance and 12+ cucushift Azure HyperShift workflows. Adds DNS_ZONE_RG_NAME env var (default os4-common) matching the create chain, and passes it to the destroy command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…hift#78516) * fix: add --dns-zone-rg-name to Azure self-managed destroy step openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. The destroy-management-cluster step in the self-managed workflow was not passing it, causing every e2e-azure-self-managed run to fail during cleanup and leak Azure clusters. The create step already passes --dns-zone-rg-name=os4-common; this adds the same flag to the destroy step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add --dns-zone-rg-name to Azure destroy steps openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. Two destroy chains were not passing it, causing every Azure HyperShift job to fail during cleanup and leak Azure clusters. hypershift-destroy-nested-management-cluster: used by e2e-azure-self-managed jobs. The create step already passes --dns-zone-rg-name=os4-common; adds the same to the destroy step. hypershift-azure-destroy: used by AKS conformance and 12+ cucushift Azure HyperShift workflows. Adds DNS_ZONE_RG_NAME env var (default os4-common) matching the create chain, and passes it to the destroy command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…hift#78516) * fix: add --dns-zone-rg-name to Azure self-managed destroy step openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. The destroy-management-cluster step in the self-managed workflow was not passing it, causing every e2e-azure-self-managed run to fail during cleanup and leak Azure clusters. The create step already passes --dns-zone-rg-name=os4-common; this adds the same flag to the destroy step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add --dns-zone-rg-name to Azure destroy steps openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. Two destroy chains were not passing it, causing every Azure HyperShift job to fail during cleanup and leak Azure clusters. hypershift-destroy-nested-management-cluster: used by e2e-azure-self-managed jobs. The create step already passes --dns-zone-rg-name=os4-common; adds the same to the destroy step. hypershift-azure-destroy: used by AKS conformance and 12+ cucushift Azure HyperShift workflows. Adds DNS_ZONE_RG_NAME env var (default os4-common) matching the create chain, and passes it to the destroy command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…hift#78516) * fix: add --dns-zone-rg-name to Azure self-managed destroy step openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. The destroy-management-cluster step in the self-managed workflow was not passing it, causing every e2e-azure-self-managed run to fail during cleanup and leak Azure clusters. The create step already passes --dns-zone-rg-name=os4-common; this adds the same flag to the destroy step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add --dns-zone-rg-name to Azure destroy steps openshift/hypershift#8322 made --dns-zone-rg-name a required flag on `hypershift destroy cluster azure`. Two destroy chains were not passing it, causing every Azure HyperShift job to fail during cleanup and leak Azure clusters. hypershift-destroy-nested-management-cluster: used by e2e-azure-self-managed jobs. The create step already passes --dns-zone-rg-name=os4-common; adds the same to the destroy step. hypershift-azure-destroy: used by AKS conformance and 12+ cucushift Azure HyperShift workflows. Adds DNS_ZONE_RG_NAME env var (default os4-common) matching the create chain, and passes it to the destroy command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
--dns-zone-rg-namea required flag onhypershift destroy cluster azurehypershift-destroy-nested-management-cluster: used bye2e-azure-self-managedjobs — adds--dns-zone-rg-name=os4-commonto the destroy command (matching the create step)hypershift-azure-destroy: used by AKS conformance and 12+ cucushift Azure HyperShift workflows — addsDNS_ZONE_RG_NAMEenv var (defaultos4-common, matching the create chain) and passes it to the destroy commandTest plan
pull-ci-openshift-hypershift-main-e2e-azure-self-managedpasses the destroy step🤖 Generated with Claude Code
Summary by CodeRabbit