Scenario 4: Destroy Command — No Regression

ObjectiveVerify hcp destroy cluster works across platforms without regression
Maps toNo regression in existing CLI functionality (destroy path)
Why this mattersUnlike --help or flag validation, the destroy command actually creates a k8s client (which uses controller-runtime), making this a genuine integration test of the logger fix

Verification Steps

StepCheckResultEvidence
1 Run hcp destroy cluster azure (nonexistent cluster) PASS Correct JSON log + expected error; no warning
2 Run hcp destroy cluster aws (flag validation) PASS Correct error about missing credentials; no warning
3 Verify no log.SetLogger warning in either PASS grep count = 0

Evidence

Step 1: hcp destroy cluster azure (nonexistent cluster)

This exercises the real controller-runtime client path: cobra dispatches to the destroy handler, the handler creates a k8s client (where SetLogger matters), the client looks up the cluster, gets a not-found, and exits.

$ KUBECONFIG=/Users/brcox/aws_dev_kubeconfig /tmp/hcp-after destroy cluster azure \
    --name nonexistent-cluster-78310 \
    --azure-creds /Users/brcox/.azure/self-managed-azure-credentials.json \
    --dns-zone-rg-name fake-rg 2>&1
{"level":"info","ts":"2026-07-13T08:47:29-04:00","msg":"Hosted cluster not found, destroying infrastructure from user input","namespace":"clusters","name":"nonexistent-cluster-78310","infraID":""}
Error: required inputs are missing: infrastructure ID is required
required inputs are missing: infrastructure ID is required

Step 2: hcp destroy cluster aws (flag validation)

$ KUBECONFIG=/Users/brcox/aws_dev_kubeconfig /tmp/hcp-after destroy cluster aws \
    --name nonexistent-cluster-78310 \
    --region us-east-1 2>&1
Error: 'sts-creds' and 'role-arn' are required
'sts-creds' and 'role-arn' are required

Step 3: Warning grep

$ /tmp/hcp-after destroy cluster azure ... 2>&1 | grep -c "log.SetLogger"
0
$ /tmp/hcp-after destroy cluster aws ... 2>&1 | grep -c "log.SetLogger"
0

« Scenario 3: Platform Create Commands Scenario 5: Basic CLI Functionality »