Refactor uninstall to add -purge
flag
#60
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR description
This PR updates the uninstall behavior to preserve user data by default. It ensures that only the binaries directory is removed during uninstallation, while keeping ProgramData and configuration files intact unless explicitly requested using the
-Purge
flag.Github issue
BUG: Uninstall-Containerd too destructive #40
Background information
Previously, the uninstall command removed all directories related to the tool, including the ProgramData folder. This could unintentionally delete user-generated data, logs, or configurations.
What does this PR do
Previously, the uninstall command removed all directories related to the tool, including the ProgramData folder. This could unintentionally delete user-generated data, logs, or configurations.
This update modifies the uninstall logic to:
This change makes the uninstall process safer and more predictable by default, while still giving users full control to clean up everything if desired.
TODOs not included in this PR
The help messages are almost the same for all the tools. To make it easier to update the help messages, use Comment-based help. Update docs to use inline function documentation #56
Testing information
To install the binaries only:
Uninstall-Containerd
To uninstall all tool related data:
Checklist
As part of our commitment to engineering excellence, before submitting this PR, please make sure:
In addition, after this PR has been reviewed, please agree to: