Skip to content

fix(eks): cluster delete refuses its own cluster when the ownership query returns an empty regionΒ #6368

Description

@devantler

πŸ€– Generated by the Agentic Engineer

Evidence

First post-#6363 dispatch of System Test - EKS (run 30201658347, 2026-07-26). During teardown:

βœ— verify AWS cluster ownership for "st-eks-30201658347-1": exact AWS ownership query
  returned a different region: got "", want "us-east-1"
##[warning]ksail cluster delete failed.
##[warning]Cluster still present; falling back to eksctl delete cluster.

eksctl delete cluster then removed the nodegroup, OIDC provider, addon and control plane normally, so the cluster was reclaimed β€” but by the fallback, not by ksail.

Problem / audience

Anyone running ksail cluster delete against EKS. The ownership pre-check compares the region it resolves from the AWS ownership query against the requested region, and the query is returning an empty string. Empty never equals us-east-1, so the guard rejects a cluster that ksail itself created moments earlier and refuses to delete it.

The guard is right to exist β€” deleting a cluster you do not own is exactly what it should prevent β€” but an empty result is being treated as "a different owner" rather than "the query returned nothing". Those are different conditions and only one of them should block a delete.

For a user with no eksctl fallback in front of them, the result is a live, billable EKS cluster that ksail cluster delete will not remove, reported as a failed delete rather than as a refusal it could act on.

Expected behaviour

An ownership query that returns no region should be distinguished from one that returns a conflicting region. A conflicting region must still block. An empty result should either retry/resolve the region from the request context, or fail with a message naming what could not be resolved and how to override.

Acceptance criteria

  • ksail cluster delete removes an EKS cluster ksail just created, in the same region, without falling back to eksctl.
  • A genuinely conflicting region still blocks the delete (RED-proved).
  • An unresolvable ownership query fails with a message that names the empty field, not a got "" want <region> comparison that reads as a mismatch.
  • Covered by a test that pins the empty-vs-conflicting distinction, so the two cannot collapse again.

Notes

Surfaced by the teardown safety net added in #6363, which is doing its job: it detected the cluster was still present after the failed delete and reclaimed it. That net is what stands between this defect and a stranded billable cluster β€” it is not a reason to leave the defect in place.

Blocks the end-to-end proof tracked in devantler-tech/platform#2327. Rough size: S.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions