Skip to content

Commit

Permalink
pkg/podman: Try to parse the error from 'podman pull' into a Go error
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryMichal authored and debarshiray committed Jul 4, 2021
1 parent 146c93b commit 5c32490
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pkg/podman/podman.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,13 @@ func IsToolboxImage(image string) (bool, error) {

// Pull pulls an image
func Pull(imageName string) error {
var stderr bytes.Buffer

logLevelString := LogLevel.String()
args := []string{"--log-level", logLevelString, "pull", imageName}

if err := shell.Run("podman", nil, nil, nil, args...); err != nil {
if err := shell.Run("podman", nil, nil, &stderr, args...); err != nil {
err := parseErrorMsg(&stderr)
return err
}

Expand Down

0 comments on commit 5c32490

Please sign in to comment.