diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-16 12:25:26 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-16 15:53:58 -0500 |
commit | 241326a9a8c20ad7f2bcf651416b836e7778e090 (patch) | |
tree | 4001e8e47a022bb1b9bfbf2332c42e1aeb802f9e /cmd/podmanV2/report | |
parent | 88c6fd06cd54fb9a8826306dfdf1a77e400de5de (diff) | |
download | podman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.gz podman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.bz2 podman-241326a9a8c20ad7f2bcf651416b836e7778e090.zip |
Podman V2 birth
remote podman v1 and replace with podman v2.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podmanV2/report')
-rw-r--r-- | cmd/podmanV2/report/diff.go | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/cmd/podmanV2/report/diff.go b/cmd/podmanV2/report/diff.go deleted file mode 100644 index b36189d75..000000000 --- a/cmd/podmanV2/report/diff.go +++ /dev/null @@ -1,44 +0,0 @@ -package report - -import ( - "fmt" - "os" - - "github.com/containers/libpod/pkg/domain/entities" - "github.com/containers/storage/pkg/archive" - jsoniter "github.com/json-iterator/go" - "github.com/pkg/errors" -) - -type ChangesReportJSON struct { - Changed []string `json:"changed,omitempty"` - Added []string `json:"added,omitempty"` - Deleted []string `json:"deleted,omitempty"` -} - -func ChangesToJSON(diffs *entities.DiffReport) error { - body := ChangesReportJSON{} - for _, row := range diffs.Changes { - switch row.Kind { - case archive.ChangeAdd: - body.Added = append(body.Added, row.Path) - case archive.ChangeDelete: - body.Deleted = append(body.Deleted, row.Path) - case archive.ChangeModify: - body.Changed = append(body.Changed, row.Path) - default: - return errors.Errorf("output kind %q not recognized", row.Kind) - } - } - - json := jsoniter.ConfigCompatibleWithStandardLibrary - enc := json.NewEncoder(os.Stdout) - return enc.Encode(body) -} - -func ChangesToTable(diffs *entities.DiffReport) error { - for _, row := range diffs.Changes { - fmt.Fprintln(os.Stdout, row.String()) - } - return nil -} |