-
Notifications
You must be signed in to change notification settings - Fork 5k
Improve user feedback for slow docker operations during delete #21200
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
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: skartikey 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 |
Welcome @skartikey! |
Hi @skartikey. 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-sigs/prow repository. |
Can one of the admins verify this patch? |
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 for this PR please take a look at the unit test
"make test"
cli_runner_test.go:44: runCmd does not print the correct log, instead print :! "sleep 3" is taking an unusually long time to respond, please be patient.
pkg/drivers/kic/oci/cli_runner.go
Outdated
// Show immediate warning that the operation is slow | ||
out.WarningT(`"{{.command}}" is taking an unusually long time to respond, please be patient.`, out.V{"command": rr.Command()}) | ||
// Don't show any restarting hint, when running podman locally (on linux, with sudo). Only when having a service. | ||
if cmd.Args[0] != "sudo" { |
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.
this doesnt seem right, "sudo" could mean a lot of things, doesnt mean podman on linux, this check probably adds more harm than good
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.
@medyagh Thanks for the feedback! You're right that hardcoding "sudo" string comparison isn't ideal in general. However, I kept this approach because it's already consistently used throughout the codebase:
-
Existing pattern in
PrefixCmd()
: The code already explicitly adds"sudo"
as a string literal:cmdWithSudo := exec.Command("sudo", append(append([]string{"-n"}, o.sudoFlags...), cmd.Args...)...)
-
Controlled context: Since minikube controls the command construction through
PrefixCmd()
, we know exactly when and how"sudo"
is added. -
Limited scope: This helper function only processes commands that minikube itself constructs.
I've added a comment to clarify this:
// If not using sudo, return the first argument
// Note: This checks for "sudo" specifically because PrefixCmd()
// explicitly adds "sudo" as a string literal when needed
if cmdArgs[0] != "sudo" {
return cmdArgs[0]
}
That said, if you have a preferred alternative approach for identifying the actual OCI binary name when sudo is involved, I'm happy to implement it. Some options could be:
- Using
filepath.Base()
to check just the binary name - Passing a flag from
PrefixCmd()
indicating if sudo was added - A different method altogether
What would you prefer?
/test |
@medyagh: The
The following commands are available to trigger optional jobs:
Use
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-sigs/prow repository. |
b28762e
to
9f44a4f
Compare
Description:
Fixes #19577
Problem
When docker daemon is slow or unresponsive,
minikube delete
operations hang indefinitely without providing feedback to users. This leads to confusion where users don't know if minikube is working or stuck.Solution
Enhanced docker command execution to provide immediate feedback and prevent infinite hangs:
Before:
After: