-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Run podman as USER then as sudo in driver check #13061
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions 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/test-infra repository. I understand the commands that are listed here. |
Hi @djplt. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: djplt The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Can one of the admins verify this patch? |
cmd.Env = append(os.Environ(), "LANG=C", "LC_ALL=C") // sudo is localized | ||
// Run podman as USER, if that fails run podman as sudo | ||
o, err = cmd.Output() | ||
if err != nil && sudoNeedsPassword() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we run this only if sudo needs password?
what if sudo does NOT need password, we dont wanna run it then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you very much for taking this issue @djplt
just minor comments
and please check the CLA singing
@@ -167,3 +174,8 @@ func status() registry.State { | |||
|
|||
return registry.State{Error: err, Installed: true, Healthy: false, Doc: docURL} | |||
} | |||
|
|||
func sudoNeedsPassword() bool { | |||
err := exec.Command("sudo", "-n", "ls").Run() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a cheaper way than executing a command ? (since this code is used in driver check it would worth to optimize second to miliseconds
how about this one ? https://askubuntu.com/questions/357220/how-to-check-if-sudo-password-has-been-entered-for-this-terminal-session#:~:text=If%20a%20password%20is%20required,2%3E%2Fdev%2Fnull%20.
if sudo -n true 2>/dev/null```
Can we rather use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works.
At least you have to let pkg/drivers/kic/oci.podmanSystemInfo()
to report Rootless bool
to the caller, otherwise kubelet and CRI can't work with Rootless Podman.
Please see #12901
I think the changes are in conflict with #12901 and so I've merged with that branch (assuming it will be merged in). I've gone for a simpler approach where only root or rootless will be attempted in a given driver check. |
I signed it |
@klaases yes I believe so. However, my changes were in conflict with #12901 so I merged those changes into this branch as per the comments of @AkihiroSuda. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
@klaases and @AkihiroSuda I've merged in the latest master branch - it appears to be working now. Happy to get this re-reviewed thanks. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
/ok-to-test |
Hi @djplt, this PR has a merge conflict, could you please rebase and then push it up and then I can take a look at it, thanks! |
2276180
to
4635668
Compare
@spowelljr that's been done now! |
kvm2 driver with docker runtime
Times for minikube (PR 13061) start: 50.0s 49.5s 50.4s 50.6s 50.6s Times for minikube ingress: 25.6s 29.1s 29.1s 29.1s 25.6s docker driver with docker runtime
Times for minikube start: 24.6s 24.8s 25.7s 25.1s 25.7s Times for minikube ingress: 21.9s 22.4s 22.0s 23.9s 21.9s docker driver with containerd runtime
Times for minikube start: 29.3s 38.4s 28.6s 28.3s 28.5s Times for minikube ingress: 22.4s 22.4s 32.4s 32.4s 21.9s |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
Instructions 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/test-infra repository. |
Fixes #11973