Fix podman inspect to return errors on failure

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh 2020-04-19 07:53:24 -04:00
parent 8884f6a4f3
commit fc76fbf945
No known key found for this signature in database
GPG Key ID: A2DF901DABE2C028
1 changed files with 6 additions and 2 deletions

View File

@ -84,10 +84,14 @@ func inspect(cmd *cobra.Command, args []string) error {
} }
} }
var lastErr error
for id, e := range results.Errors { for id, e := range results.Errors {
fmt.Fprintf(os.Stderr, "%s: %s\n", id, e.Error()) if lastErr != nil {
fmt.Fprintf(os.Stderr, "%s: %s\n", id, lastErr.Error())
} }
return nil lastErr = e
}
return lastErr
} }
func inspectFormat(row string) string { func inspectFormat(row string) string {