Verify hcp destroy cluster works across platforms without regression
Maps to
No regression in existing CLI functionality (destroy path)
Why this matters
Unlike --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
Result: PASS — Destroy commands work correctly on both Azure and AWS paths with no regression. Clean JSON log output, correct error handling, no warning.
Verification Steps
Step
Check
Result
Evidence
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
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