rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
6.04k stars 285 forks source link

rdctl factory-reset asks for sudo password via WSL #4539

Open IsaSih opened 1 year ago

IsaSih commented 1 year ago

Actual Behavior

rdctl factory-reset asks for sudo password when bats are running via WSL

Steps to Reproduce

  1. Start Rancher Desktop (installed build)
  2. Run factory-rest.bats from a WSL distro (Ubuntu)
  3. Verify that the sudo password is requested in the terminal

Result

rdctl factory-reset asks for sudo password via WSL

Expected Behavior

rdctl factory-reset must NOT ask for a sudo password as it does not perform any sudo commands

Additional Information

No response

Rancher Desktop Version

1.9.0-tech-preview

Rancher Desktop K8s Version

N/A

Which container engine are you using?

containerd (nerdctl)

What operating system are you using?

Windows

Operating System / Build Version

windows 11

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

No response

Nino-K commented 1 year ago

I believe part of the problem is because, we do this iptables cleanup during factory reset on Windows that requires sudo.

jandubois commented 1 year ago

Yes, you are supposed to have enabled passwordless sudo in the distro you use to run BATS on Windows:

jan@DESKTOP-4992680:~$ sudo cat /etc/sudoers.d/nopasswd
%sudo ALL=(ALL) NOPASSWD:ALL

4529 mentions that this needs to be added to the README, so this issue might be closed as a duplicate.

However it looks like #4513 has been closed as a duplicate of this issue, which isn't correct because that issue is on Linux, not Windows, so should maybe be reopened for verification.