Scenario 7: Infra Destroy Handles Both DNS Zone Naming Formats

Objective: Verify hypershift destroy cluster azure cleans up DNS zones with both the old {name}-azurecluster.{baseDomain} and new {name}.{baseDomain} naming formats.

Cluster: brcox-100054-hc, infraID brcox-100054-hc-7prcj

Overall Scenario 7: PASS — Destroy completed (exit 0), cluster fully removed, all RGs deleted.
StepCheckResultEvidence
1 Destroy the cluster infrastructure PASS Command exited 0. "Successfully destroyed cluster and infrastructure" infraID="brcox-100054-hc-7prcj" at 2026-08-05T12:51:27-04:00
2 New naming format zone ({name}.{baseDomain}) cleaned up PASS Zone brcox-100054-hc.hcp-sm-azure.azure.devcluster.openshift.com in RG brcox-100054-hc-brcox-100054-hc-7prcj — RG deleted (az group existsfalse)
3 Old naming format zone ({name}-azurecluster.{baseDomain}) cleaned up PASS Zone brcox-100054-hc-azurecluster.hcp-sm-azure.azure.devcluster.openshift.com in same RG — RG deleted (az group existsfalse)

Commands & Outputs

Step 1: Destroy cluster

$ KUBECONFIG=/Users/brcox/azure_dev_mgmt_kubeconfig ./bin/hypershift destroy cluster azure \
  --name brcox-100054-hc \
  --namespace clusters \
  --azure-creds /Users/brcox/.azure/self-managed-azure-credentials.json \
  --dns-zone-rg-name os4-common

{"level":"info","ts":"2026-08-05T12:30:00-04:00","msg":"Found hosted cluster","namespace":"clusters","name":"brcox-100054-hc"}
{"level":"info","ts":"2026-08-05T12:30:00-04:00","msg":"Marking cleanup of cloud resources for hosted cluster","namespace":"clusters","name":"brcox-100054-hc"}
{"level":"info","ts":"2026-08-05T12:30:00-04:00","msg":"Deleting hosted cluster","namespace":"clusters","name":"brcox-100054-hc"}
{"level":"info","ts":"2026-08-05T12:50:01-04:00","msg":"Force removal of all finalizers complete","namespace":"clusters","name":"brcox-100054-hc"}
{"level":"info","ts":"2026-08-05T12:51:26-04:00","msg":"Successfully cleaned up all role assignments","infraID":"brcox-100054-hc-7prcj"}
{"level":"info","ts":"2026-08-05T12:51:26-04:00","msg":"Deleting main resource group","resource-group":"brcox-100054-hc-brcox-100054-hc-7prcj"}
{"level":"info","ts":"2026-08-05T12:51:27-04:00","msg":"Finalized hosted cluster","namespace":"clusters","name":"brcox-100054-hc"}
{"level":"info","ts":"2026-08-05T12:51:27-04:00","msg":"Successfully destroyed cluster and infrastructure","namespace":"clusters","name":"brcox-100054-hc","infraID":"brcox-100054-hc-7prcj"}

Step 2: Verify HC deleted

$ kubectl get hostedcluster -n clusters brcox-100054-hc
Error from server (NotFound): hostedclusters.hypershift.openshift.io "brcox-100054-hc" not found

$ kubectl get ns clusters-brcox-100054-hc
Error from server (NotFound): namespaces "clusters-brcox-100054-hc" not found

Step 3: Verify Azure RGs deleted

$ az group exists --name brcox-100054-hc-brcox-100054-hc-7prcj
false

$ az group exists --name brcox-100054-hc-vnet-brcox-100054-hc-7prcj
false

$ az group exists --name brcox-100054-hc-nsg-brcox-100054-hc-7prcj
false

Step 4: DNS zones before destroy (captured pre-teardown)

$ az network private-dns zone list --resource-group brcox-100054-hc-brcox-100054 -o table
ZoneName                                                                  ResourceGroup
------------------------------------------------------------------------  ----------------------------
brcox-100054-hc-azurecluster.hcp-sm-azure.azure.devcluster.openshift.com  brcox-100054-hc-brcox-100054
brcox-100054-hc.hcp-sm-azure.azure.devcluster.openshift.com               brcox-100054-hc-brcox-100054
brcox-100054-hc.hypershift.local                                          brcox-100054-hc-brcox-100054
hcp-sm-azure.azure.devcluster.openshift.com                               brcox-100054-hc-brcox-100054
← Scenario 6 Scenario 8 →