Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Uninstall-Containerd too destructive #40

Open
profnandaa opened this issue Jan 23, 2025 · 2 comments
Open

BUG: Uninstall-Containerd too destructive #40

profnandaa opened this issue Jan 23, 2025 · 2 comments

Comments

@profnandaa
Copy link
Member

Describe the bug

I think Uninstall-Containerd is doing more than needed. I suggest we only uninstall what we install, but not touch the installations in $env:GOPATH/bin.

PS C:\> Uninstall-Containerd

Confirm
Are you sure you want to perform this action?
Performing the operation "Containerd will be uninstalled from C:\Users\uname\go and containerd service will be stopped and unregistered" on target
"CPC-unam-6MIB0".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y

Are you sure you want to uninstall Containerd?
C:\Users\uname\go
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y
WARNING: Uninstalling preinstalled Containerd at the path C:\Users\uname\go
Remove-Item: The process cannot access the file 'C:\Users\uname\go\bin\containerd-shim-runhcs-v1.exe' because it is being used by another process.
Remove-Item: Access to the path 'C:\Users\uname\go\bin\dlv.exe' is denied.
Remove-Item: The directory is not empty. : 'C:\Users\uname\go\bin'

To Reproduce

Detailed steps to reproduce the behavior:

  1. Have other own custom containerd installation in $env:GOPATH/bin
  2. Run Uninstall-Containerd

The more information you can provide, the more likely someone will be successful at triaging and reproducing the issue and finding a fix.

Expected behavior

Uninstall only containerd stuff in $env:ProgramFiles\containerd. (together with all CNI, perhaps the user needs to be told that too since we have: Install-WinCNIPlugin that puts stuff in that directory too)

@profnandaa
Copy link
Member Author

Also not sure whether we should remove the stuff in C:\ProgramData\containerd\:

Image

Perhaps this can be another question to ask wether to remove, especially for those that have other instances of containerd installed in $GOPATH.

@TinaMor
Copy link
Contributor

TinaMor commented Jan 29, 2025

  1. That's why we ask the user to confirm before uninstallation. We could skip the uninstall instead and proceed with installation of the new version. However, if the user does not specify the path to install the new version, it will overwrite the existing version
  2. It finds the location of the command e.g containerd using Get-Command and returns the first location. The 'Uninstall-Command` has the option to provide the location of the binaries.

@TinaMor TinaMor linked a pull request Feb 5, 2025 that will close this issue
6 tasks
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 a pull request may close this issue.

2 participants