Skip to content

Commit

Permalink
Merge pull request containers#7969 from ParkerVR/format-images/diff
Browse files Browse the repository at this point in the history
--format updates for images/diff.go
  • Loading branch information
openshift-merge-robot authored Oct 8, 2020
2 parents 2a63795 + c254a73 commit 2587cba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/podman/images/diff.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package images

import (
"github.com/containers/podman/v2/cmd/podman/parse"
"github.com/containers/podman/v2/cmd/podman/registry"
"github.com/containers/podman/v2/cmd/podman/report"
"github.com/containers/podman/v2/pkg/domain/entities"
Expand Down Expand Up @@ -49,11 +50,11 @@ func diff(cmd *cobra.Command, args []string) error {
return err
}

switch diffOpts.Format {
case "":
return report.ChangesToTable(results)
case "json":
switch {
case parse.MatchesJSONFormat(diffOpts.Format):
return report.ChangesToJSON(results)
case diffOpts.Format == "":
return report.ChangesToTable(results)
default:
return errors.New("only supported value for '--format' is 'json'")
}
Expand Down

0 comments on commit 2587cba

Please sign in to comment.