Skip to content

fix(cli): prevent uninstall timeout by deleting CRDs before controller#91

Open
1012Charan wants to merge 1 commit intokubeslice:masterfrom
1012Charan:master
Open

fix(cli): prevent uninstall timeout by deleting CRDs before controller#91
1012Charan wants to merge 1 commit intokubeslice:masterfrom
1012Charan:master

Conversation

@1012Charan
Copy link

Description

This PR fixes the timeout issue that occurs during KubeSlice uninstallation. When users run kubeslice-cli uninstall -c, the process would get stuck and fail with a "timed out waiting for the condition" error.

Why was it happening?

The uninstall process was trying to delete the controller first, but the controller couldn't be deleted because workers were still using it. It's like trying to delete a folder while some programs are still using files inside it.

Solution

The fix changes the uninstall order to be smarter:

  1. Delete CRDs first - This tells workers "stop what you're doing"
  2. Wait 2 seconds - Give workers time to clean up
  3. Delete controller - Now it can be removed safely
  4. Added timeout - Don't wait forever if something goes wrong

Changes Made

  • Added deleteKubeSliceCRDs() function to delete KubeSlice CRDs
  • Modified UninstallKubeSliceController() to delete CRDs before controller
  • Added --timeout parameter to helm uninstall command

Fixes #58

How Has This Been Tested?

Test Cases:

  • Test case A: Run kubeslice-cli uninstall -c topology.yaml - should complete successfully without timeout
  • Test case B: Verify CRDs are deleted before controller uninstallation

Test Instructions:

  1. Install KubeSlice: kubeslice-cli install -c topology.yaml
  2. Run uninstall: kubeslice-cli uninstall -c topology.yaml
  3. Verify it completes successfully without timeout errors

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit test cases.

Does this PR introduce a breaking change?

No, this is a bug fix that makes the uninstall process more reliable. The same command works the same way, just without the timeout issue.

@1012Charan
Copy link
Author

@narmidm kindly review this

@Arpit529Srivastava
Copy link

@1012Charan can you please add DCO to your commit.
not the maintainer just trying to help :)

Previously, uninstall would fail with 'timed out waiting for the condition' because the controller was removed before workers stopped using it.

This change:
- Deletes KubeSlice CRDs before removing the controller
- Waits 2 seconds for cleanup
- Adds timeout flag to helm uninstall for reliability

Fixes kubeslice#58

Signed-off-by: 1012Charan <charanvengala@gmail.com>
@1012Charan 1012Charan changed the title Fix: Uninstall timeout issue - Delete CRDs before controller removal fix(cli): prevent uninstall timeout by deleting CRDs before controller Aug 8, 2025
@1012Charan
Copy link
Author

hey @Arpit529Srivastava, I've included DCO as you mentioned. Appreciate your help!

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.

Bug: Change Uninstall process of cli - sometimes it fails during controller uninstallation

2 participants