summaryrefslogtreecommitdiff
path: root/pkg/adapter/runtime_remote.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/adapter/runtime_remote.go')
-rw-r--r--pkg/adapter/runtime_remote.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/pkg/adapter/runtime_remote.go b/pkg/adapter/runtime_remote.go
index 48d7eb986..978c9ffd8 100644
--- a/pkg/adapter/runtime_remote.go
+++ b/pkg/adapter/runtime_remote.go
@@ -824,3 +824,30 @@ func (r *LocalRuntime) Events(c *cliconfig.EventValues) error {
}
return nil
}
+
+// Diff ...
+func (r *LocalRuntime) Diff(c *cliconfig.DiffValues, to string) ([]archive.Change, error) {
+ var changes []archive.Change
+ reply, err := iopodman.Diff().Call(r.Conn, to)
+ if err != nil {
+ return nil, err
+ }
+ for _, change := range reply {
+ changes = append(changes, archive.Change{Path: change.Path, Kind: stringToChangeType(change.ChangeType)})
+ }
+ return changes, nil
+}
+
+func stringToChangeType(change string) archive.ChangeType {
+ switch change {
+ case "A":
+ return archive.ChangeAdd
+ case "D":
+ return archive.ChangeDelete
+ default:
+ logrus.Errorf("'%s' is unknown archive type", change)
+ fallthrough
+ case "C":
+ return archive.ChangeModify
+ }
+}