chroot/run.go: check errors in deferred calls
Reported by golangci-lint.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Closes: #1624
Approved by: TomSweeneyRedHat
Valentin Rothberg authored 4 years ago
Atomic Bot committed 4 years ago
506 | 506 | return 1, err |
507 | 507 | } |
508 | 508 | defer func() { |
509 | undoIntermediates() | |
509 | if undoErr := undoIntermediates(); undoErr != nil { | |
510 | err = errors.Wrap(err, undoErr.Error()) | |
511 | } | |
510 | 512 | }() |
511 | 513 | |
512 | 514 | // Bind mount in our filesystems. |
515 | 517 | return 1, err |
516 | 518 | } |
517 | 519 | defer func() { |
518 | undoChroots() | |
520 | if undoErr := undoChroots(); undoErr != nil { | |
521 | err = errors.Wrap(err, undoErr.Error()) | |
522 | } | |
519 | 523 | }() |
520 | 524 | |
521 | 525 | // Create a pipe for passing configuration down to the next process. |