diff --git a/tests/e2e/common.go b/tests/e2e/common.go index e232c636..800bed81 100644 --- a/tests/e2e/common.go +++ b/tests/e2e/common.go @@ -123,7 +123,11 @@ func commonCmdExec(command string) (output string, err error) { } func commonPull(tool string, image string) error { - pullCmd := tool + " image pull " + image + pullCmd := tool + " image pull " + if !verbosePull() { + pullCmd += "-q " + } + pullCmd += image output, err := commonCmdExec(pullCmd) if err != nil { diff --git a/tests/e2e/utils.go b/tests/e2e/utils.go index b8372557..4845be4e 100644 --- a/tests/e2e/utils.go +++ b/tests/e2e/utils.go @@ -81,8 +81,11 @@ func pullImageWithRetry(testFunc string, image string) error { func pullImageForTest(testFunc string, image string) error { switch testFunc { case testCrictl: - cmd := crictlName + " pull " + image - output, err := commonCmdExec(cmd) + cmd := crictlName + " pull " + if !verbosePull() { + cmd += "-q " + } + cmd += image if err != nil { return fmt.Errorf("%s -- %v", output, err) } @@ -257,3 +260,9 @@ func findLineInFile(filePath string, pattern string) (string, error) { return "", fmt.Errorf("Pattern %s was not found in any line of %s", pattern, filePath) } + +// Set URUNC_VERBOSE_PULL=true locally to see pull progress output +func verbosePull() bool { + v := os.Getenv("URUNC_VERBOSE_PULL") + return v == "1" || v == "true" +}