Skip to content

Commit

Permalink
Check exit code in PrepareBackup()
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Aug 31, 2016
1 parent 5f1bbe6 commit a6d5056
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions providers/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ func PrepareBackup(p Provider) (err error) {
if err != nil {
return fmt.Errorf("failed to start exec: %v", err)
}

inspect, err := client.ContainerExecInspect(context.Background(), exec.ID)
if err != nil {
return fmt.Errorf("failed to check prepare command exit code: %v", err)
}
if c := inspect.ExitCode; c != 0 {
return fmt.Errorf("prepare command exited with code %v", c)
}
} else {
log.WithFields(log.Fields{
"volume": vol.Name,
Expand Down

0 comments on commit a6d5056

Please sign in to comment.