Skip to content

Commit

Permalink
Merge #2559
Browse files Browse the repository at this point in the history
2559: run: use the correct error for errors.Wrapf r=rhatdan a=giuseppe

#### What type of PR is this?

/kind bug

#### What this PR does / why we need it:

#### How to verify it

#### Which issue(s) this PR fixes:

None

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
None
```


Co-authored-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
bors[bot] and giuseppe authored Aug 22, 2020
2 parents 6bbc481 + 62dcf0c commit 9996223
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions run_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,12 +864,12 @@ func runUsingRuntime(isolation Isolation, options RunOptions, configureNetwork b
stat := exec.Command(runtime, args...)
stat.Dir = bundlePath
stat.Stderr = os.Stderr
stateOutput, stateErr := stat.Output()
if stateErr != nil {
return 1, errors.Wrapf(stateErr, "error reading container state")
stateOutput, err := stat.Output()
if err != nil {
return 1, errors.Wrapf(err, "error reading container state (got output: %q)", string(stateOutput))
}
if err = json.Unmarshal(stateOutput, &state); err != nil {
return 1, errors.Wrapf(stateErr, "error parsing container state %q", string(stateOutput))
return 1, errors.Wrapf(err, "error parsing container state %q", string(stateOutput))
}
switch state.Status {
case "running":
Expand Down

0 comments on commit 9996223

Please sign in to comment.