feat: add quiet image pulls by default#665
Conversation
Signed-off-by: 7h3-3mp7y-m4n <emailtorash@gmail.com>
✅ Deploy Preview for urunc canceled.
|
cmainas
left a comment
There was a problem hiding this comment.
Hello @7h3-3mp7y-m4n ,
thank you for this. I am not sure if this works correctly (see a comment below). Please test your changes before opening a PR.
| switch testFunc { | ||
| case testCrictl: | ||
| cmd := crictlName + " pull " + image | ||
| output, err := commonCmdExec(cmd) |
There was a problem hiding this comment.
This one should not get removed.
There was a problem hiding this comment.
okay, I'll do the changes
|
|
||
| // Set URUNC_VERBOSE_PULL=true locally to see pull progress output | ||
| func verbosePull() bool { | ||
| v := os.Getenv("URUNC_VERBOSE_PULL") |
There was a problem hiding this comment.
We can use strcov.ParseBool for a better handling of the value.
There was a problem hiding this comment.
Yeah, you are right, it would be very handy for local debugging.
The sad part is that I can't test it locally, because certain things can't work with my MacOS system :( , I do have a Rancher and I can run some nerdctl command and could verify the If there are other ways, then I would love to know about them. |
|
Hello @7h3-3mp7y-m4n ,
you can use a VM for that and test at least whatever is possible (e.g. spt images). |
|
Hey @cmainas, I have an update on this. While looking at Earlier the function always captured stdout with no way to control it, which meant noisy progress bars from Now with this flag:
The key point is stderr is always captured regardless of this flag, so even when we discard stdout for For the other tools:
func commonCmdExec(command string, discardStdout bool) (output string, err error) {
var stderrBuf bytes.Buffer
params := strings.Fields(command)
cmd := exec.Command(params[0], params[1:]...)
cmd.Stderr = &stderrBuf // always captured regardless of discardStdout
if discardStdout {
cmd.Stdout = io.Discard
err = cmd.Run()
} else {
var outBytes []byte
outBytes, err = cmd.Output()
output = strings.TrimSpace(string(outBytes))
}
if err != nil {
output += strings.TrimSpace(stderrBuf.String())
return output, err
}
return output, nil
}Tested locally, errors are visible for all four tools even in the failure case. I might be wrong with my approach, but would love to get your thoughts on this. |
|
Hello @7h3-3mp7y-m4n , this should not take place in the |
|
It would be better to introduce a new function with the stdout discard logic, rather than changing |
Okay, I'll try to make a new function and share with you how it went. |

Description
This PR suppresses noisy image pull progress output during end-to-end tests by enabling quiet image pulls by default for supported tools (e.g. docker and nerdctl).
An optional
URUNC_VERBOSE_PULLenvironment variable was added to allow verbose image pull logs when debugging is needed.Related issues
How was this tested?
LLM usage
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).