Fix kicbase image load permission denied by using docker CLI#22787
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: princebirring The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @princebirring! |
|
Hi @princebirring. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
|
Replace direct Docker daemon socket access (daemon.Write and daemon.Image from go-containerregistry) with docker CLI commands (docker load, docker image inspect) so that users who access docker via sudo wrappers or other privilege-escalation mechanisms are supported.
6aca42d to
d7914a8
Compare
|
Can one of the admins verify this patch? |
Summary
daemon.Writeanddaemon.Imagefrom go-containerregistry) with Docker CLI commands (docker load -i,docker image inspect) inpkg/minikube/download/image.gogo-containerregistry/pkg/v1/daemonimportRoot Cause
When loading the kicbase image, minikube used
daemon.Write()anddaemon.Image()from thego-containerregistrylibrary, which connect directly to the Docker socket (/var/run/docker.sock). Users who intentionally restrict direct socket access and use sudo-based Docker wrappers get "permission denied" errors, even though other minikube Docker operations (likedocker system info) work fine because they go through the Docker CLI.Test Plan
go build ./pkg/minikube/download/compiles successfullygo test ./pkg/minikube/download/passesminikube start --driver=dockeron a system where Docker requires sudo (user not in docker group, using a docker wrapper script)Fixes #22780