Skip to content

fix(console): block Add-instance on a k8s fleet instead of silently deploying to ECS - #152

Merged
brettchien merged 1 commit into
mainfrom
orca/k8s-add-instance-guard
Sep 7, 2026
Merged

fix(console): block Add-instance on a k8s fleet instead of silently deploying to ECS#152
brettchien merged 1 commit into
mainfrom
orca/k8s-add-instance-guard

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Summary

studio#146 final-review pass — the slice-7-style re-read of the merged console/ off main after all 4 slices landed (#147-#151), looking for exactly this class of "newly reachable, not caught by any single slice's tests" issue.

Before this issue, a k8s fleet couldn't be selected in the Fleets panel at all, so its Fleet detail's "+ Add instance" button was simply unreachable. Slice 4 (#151) fixed the actual bug (drilling into a k8s fleet's roster) — but that also made this button reachable for the first time, and it has a pre-existing, already-self-documented assumption: deploy.ts's compose step only shows the AWS/k8s provider <select> during the "new-fleet" identity step; "add instance" skips straight to compose and the code comment already says "an add-instance submit always sees 'aws' here regardless of the fleet it's adding to".

The practical effect, now that it's reachable: clicking "+ Add instance" on an existing k8s fleet doesn't error — it silently provisions an ECS service while the operator believes they're adding to their k8s fleet.

Fix

Guard it at the click handler in main.ts: if the active fleet's runtime === "k8s", show an info toast ("adding an instance to an existing k8s fleet isn't supported yet") and don't open the wizard — the same clear-message pattern the wizard already uses for the New-Fleet k8s-provider case that came before it was wired up. No change to deploy.ts itself; this is a pre-condition check at the one place that decides whether to open it.

Test plan

  • npm test — 107/107 passing
  • npm run typecheck — clean
  • npm run build — clean

🤖 Generated with Claude Code

…eploying to ECS

studio#146 final-review pass (mirrors studio#83 slice 7): re-reading the
merged console/ fresh off main after all 4 slices landed surfaced a
newly-reachable bug. Before this issue, a k8s fleet couldn't be selected
at all, so its Fleet detail "+ Add instance" button was unreachable. Now
that slice 4 lets you drill into one, clicking it opens `deploy.ts`'s
compose step — which assumes ECS whenever mode isn't "new-fleet" (the
provider <select> only lives in the identity step, skipped for "add
instance"; deploy.ts's own comment already flagged this as a known,
separate gap). The result wasn't an error: it would silently provision
an ECS service into what the operator thinks is a k8s fleet.

Guards the button in main.ts instead: if the active fleet's runtime is
k8s, show the same "not supported yet" toast pattern the wizard already
uses for its own not-yet-supported k8s cases, rather than let the wizard
open and do the wrong thing.

🤖 Generated with Claude Code
@brettchien
brettchien merged commit cbb2faa into main Sep 7, 2026
2 checks passed
@brettchien
brettchien deleted the orca/k8s-add-instance-guard branch September 7, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant