Skip to content

fix: show error notification when cluster deletion fails#5001

Open
XxSURYANSHxX wants to merge 2 commits intokubernetes-sigs:mainfrom
XxSURYANSHxX:fix/cluster-deletion-error-notification
Open

fix: show error notification when cluster deletion fails#5001
XxSURYANSHxX wants to merge 2 commits intokubernetes-sigs:mainfrom
XxSURYANSHxX:fix/cluster-deletion-error-notification

Conversation

@XxSURYANSHxX
Copy link
Copy Markdown

Summary

@illume @joaquimrocha This PR fixes a bug where errors from deleteCluster() were silently swallowed and the user was redirected to home with no feedback. This resolves the TODO comments in ClusterContextMenu and SettingsCluster by dispatching an error notification via the existing Redux notification system.

Related Issue

Fixes #4928

Changes

  • Updated frontend/src/components/App/Home/ClusterContextMenu.tsx to dispatch an error notification when cluster deletion fails
  • Updated frontend/src/components/App/Settings/SettingsCluster.tsx with the same error notification fix
  • Removed the // TODO: create notification with error message comments in both files

Steps to Test

  1. Add a dynamic cluster or kubeconfig-based cluster in Headlamp
  2. Attempt to delete the cluster via the ⋮ context menu on the Home page while the cluster is already unavailable on the backend (or simulate a failure)
  3. Observe that an error notification now appears in the notification bell instead of a silent redirect to /
  4. Repeat steps 1–3 from the cluster Settings page (Settings > Cluster > Remove Cluster button)

Screenshots (if applicable)

Before: user is silently redirected to home with no feedback.
After: an error notification appears in the notification bell with the cluster name and error message.

Notes for the Reviewer

  • This fix handles all errors from deleteCluster(), not just Not Found, which is a superset of what the original TODO described as this is intentional since any failure should be surfaced to the user.
  • The notification message uses the existing i18n t() function, so please check translation key consistency if needed.
  • No new dependencies or infrastructure were added; this uses the existing Notification class and setNotifications Redux action already in the codebase.

Previously, errors from deleteCluster() were silently swallowed and the
user was redirected to home with no feedback. This resolves the TODO
comments in ClusterContextMenu and SettingsCluster by dispatching an
error notification via the existing Redux notification system.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: XxSURYANSHxX
Once this PR has been reviewed and has the lgtm label, please assign sniok for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @XxSURYANSHxX!

It looks like this is your first PR to kubernetes-sigs/headlamp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/headlamp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Mar 28, 2026

CLA Missing ID CLA Not Signed

One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via:

Co-authored-by: name <email>

Supported Co-authored-by: formats include:

  1. Anything <id+login@users.noreply.github.com> - it will locate your GitHub user by id part.
  2. Anything <login@users.noreply.github.com> - it will locate your GitHub user by login part.
  3. Anything <public-email> - it will locate your GitHub user by public-email part. Note that this email must be made public on Github.
  4. Anything <other-email> - it will locate your GitHub user by other-email part but only if that email was used before for any other CLA as a main commit author.
  5. login <any-valid-email> - it will locate your GitHub user by login part, note that login part must be at least 3 characters long.

Alternatively, if the co-author should not be included, remove the Co-authored-by: line from the commit message.

Please update your commit message(s) by doing git commit --amend and then git push [--force] and then request re-running CLA check via commenting on this pull request:

/easycla

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent Error Suppression in Cluster Deletion

2 participants