summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi/containers.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-05-07 17:09:11 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-08 21:01:28 +0000
commit25263558f10b5e2e246b2349b49b1585852d57b6 (patch)
tree9cf12d770c3b3a376ffa85bdd327a3cb4e11ad99 /pkg/varlinkapi/containers.go
parent21ebdb558cb939176d862e12bec99f34a1e5d4ba (diff)
downloadpodman-25263558f10b5e2e246b2349b49b1585852d57b6.tar.gz
podman-25263558f10b5e2e246b2349b49b1585852d57b6.tar.bz2
podman-25263558f10b5e2e246b2349b49b1585852d57b6.zip
Generate varlink API documentation automatically
Using varlink's idl parser, we generate API documentation for the podman API relying on the .varlink file as the source. Signed-off-by: baude <bbaude@redhat.com> Closes: #734 Approved by: baude
Diffstat (limited to 'pkg/varlinkapi/containers.go')
-rw-r--r--pkg/varlinkapi/containers.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go
index 79eea4aa7..9468719fc 100644
--- a/pkg/varlinkapi/containers.go
+++ b/pkg/varlinkapi/containers.go
@@ -9,6 +9,7 @@ import (
"syscall"
"time"
+ "github.com/containers/storage/pkg/archive"
"github.com/pkg/errors"
"github.com/projectatomic/libpod/cmd/podman/batchcontainer"
"github.com/projectatomic/libpod/cmd/podman/libpodruntime"
@@ -195,12 +196,18 @@ func (i *LibpodAPI) ListContainerChanges(call ioprojectatomicpodman.VarlinkCall,
if err != nil {
return call.ReplyErrorOccurred(err.Error())
}
-
- m := make(map[string]string)
+ result := ioprojectatomicpodman.ContainerChanges{}
for _, change := range changes {
- m[change.Path] = change.Kind.String()
+ switch change.Kind {
+ case archive.ChangeModify:
+ result.Changed = append(result.Changed, change.Path)
+ case archive.ChangeDelete:
+ result.Deleted = append(result.Deleted, change.Path)
+ case archive.ChangeAdd:
+ result.Added = append(result.Added, change.Path)
+ }
}
- return call.ReplyListContainerChanges(m)
+ return call.ReplyListContainerChanges(result)
}
// ExportContainer ...