Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 11 additions & 2 deletions tests/e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should not get removed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I'll do the changes

cmd := crictlName + " pull "
if !verbosePull() {
cmd += "-q "
}
cmd += image
if err != nil {
return fmt.Errorf("%s -- %v", output, err)
}
Expand Down Expand Up @@ -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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use strcov.ParseBool for a better handling of the value.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you are right, it would be very handy for local debugging.

return v == "1" || v == "true"
}