Skip to content

Add workload delete to the compute portal plugin - #359

Merged
mattdjenkinson merged 3 commits into
mainfrom
feat/ui-delete-workload
Sep 25, 2026
Merged

mattdjenkinson merged 3 commits into
mainfrom
feat/ui-delete-workload

Conversation

@mattdjenkinson

@mattdjenkinson mattdjenkinson commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes datum-cloud/cloud-portal#1566. Pairs with datum-cloud/cloud-portal#1585.

You can now delete a workload from its detail page. There's a Delete button next to the health badge in the header. It opens a confirmation where you type DELETE, the same as other deletes in the portal.

What gets deleted

Deleting the Workload already removes everything the compute controllers created for it: deployments, instances, interface claims and bindings. It doesn't remove the ALB (the HTTPProxy plus the NetworkService behind it) or the Network, because nothing owns those. The dialog lists them as checkboxes, unchecked by default.

  • An ALB is disabled if it also routes to another workload. A Network is disabled if another workload attaches to it.
  • Anything the user can't delete is disabled too, with cloud-portal's wording ("You don't have permission to delete this Application Load Balancer").
  • If an ALB is left unchecked, a note says it reconnects when a workload with the same name is deployed again.

The workload is deleted first, so a refused delete leaves everything else alone. Next come the ticked ALBs and their NetworkServices; a service that an ALB you're keeping still uses is left in place. Networks go last. If an ALB or Network fails to delete, a warning toast names it.

Permissions

The Delete button is hidden when a delete SelfSubjectAccessReview on workloads fails, following cloud-portal's RBAC conventions (delete is hidden, not disabled). The host's RBAC hooks aren't available to plugins, so the plugin sends four SSARs per page through the control-plane proxy.

After confirming

The page goes straight back to the workload list and the deletes finish in the background. The workload's card and table row show a Deleting badge with a spinner until it's gone. The plugin also invalidates cloud-portal's http-proxies, network-services and compute-workloads query caches, so the ALB pages refetch when you open them. compute-workloads is new in cloud-portal#1585. Those key names are copied from the host, and there's a comment in api.ts pointing at them.

Screen.Recording.2026-09-24.at.12.25.55.mov
Screenshot 2026-09-24 at 12 17 06

The workload detail header gets a Delete button that opens a type-DELETE
confirmation, matching the portal's other delete dialogs.

Deleting the Workload removes what the compute controllers made for it,
but not the ALB (HTTPProxy and the NetworkService behind it) or the
Network. The dialog lists those as opt-in checkboxes. Anything shared
with another workload, or that the user can't delete, is disabled with a
reason. The workload is deleted first, so a refused delete touches
nothing else.

The Delete button is hidden when a delete SelfSubjectAccessReview on
workloads fails, following cloud-portal's RBAC conventions.

Confirming goes straight back to the workload list, where the workload's
card and table row show a Deleting badge until it's gone. The plugin also
invalidates cloud-portal's http-proxies, network-services and
compute-workloads caches so the ALB pages refetch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
savme
savme previously approved these changes Sep 25, 2026
@mattdjenkinson
mattdjenkinson requested a review from a team as a code owner September 25, 2026 11:19
mattdjenkinson added a commit to datum-cloud/cloud-portal that referenced this pull request Sep 25, 2026
Related to #1566. Pairs with datum-cloud/compute#359, which adds the
delete.

The compute plugin can now delete a workload and keep its ALB. That ALB
still has a NetworkService backend that selects the workload by name, so
the overview carried on saying "Serving traffic normally" and linked to
a workload page that 404s. The Backend pool card had no edit button for
compute backends, so there was no way to fix it from the portal.

`useResolvedComputeWorkload` now reads the workload as well, through the
compute SDK in a new `resources/compute-workloads` module. It sets
`workloadMissing` on a 404 or when the workload is already terminating.
A 403 or any other error leaves the page alone, because we can't tell
whether the workload exists.

When the workload is missing:

- The health strip headline becomes "No backend available", with
"Workload `<name>` was deleted. Redeploy it to reconnect." The "View
workload" chip is replaced by a "Set origin" link to the Configuration
tab.
- The endpoints and origins cards call the backend "Compute workload not
found" and drop the link.
- The Backend pool card shows a "Set origin" button. It opens the
existing origin dialog, and saving replaces the NetworkService backend
(the update adapter already lets an explicit endpoint win over it).

The link waits for the lookup, so a dead "View workload" doesn't flash
in first. Redeploying a workload with the same name reconnects the ALB
on its own, which is why the copy mentions that before anything else.

<img width="1624" height="1061" alt="Screenshot 2026-09-24 at 12 16 38"
src="https://github.com/user-attachments/assets/20934b07-2da1-4652-a737-52d31da8d434"
/>
# Conflicts:
#	ui/consumer/src/components/workload-page-chrome.tsx
#	ui/consumer/src/pages/workload-detail.tsx
@mattdjenkinson
mattdjenkinson merged commit 4cfe37a into main Sep 25, 2026
10 checks passed
@mattdjenkinson
mattdjenkinson deleted the feat/ui-delete-workload branch September 25, 2026 12:30
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.

Add delete workload button

3 participants