diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-03-04 03:58:47 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-04 03:58:47 -0800 |
commit | d63c8b00321f7e1d7c3cbfe3d1a57c9283d10d37 (patch) | |
tree | 93f6845030bd591e730ae315a6f3c47cc6e87dc0 /pkg/varlinkapi | |
parent | f3a3d8e28e4b8ec06dd11ec156c10e243165f19d (diff) | |
parent | 4d13a80fa46ce57e3c889934536320525338b3a4 (diff) | |
download | podman-d63c8b00321f7e1d7c3cbfe3d1a57c9283d10d37.tar.gz podman-d63c8b00321f7e1d7c3cbfe3d1a57c9283d10d37.tar.bz2 podman-d63c8b00321f7e1d7c3cbfe3d1a57c9283d10d37.zip |
Merge pull request #2364 from jwhonce/wip/remote_stop
Support podman-remote stop container
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/containers.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go index ad9f107a7..27b8d15d2 100644 --- a/pkg/varlinkapi/containers.go +++ b/pkg/varlinkapi/containers.go @@ -13,6 +13,7 @@ import ( "github.com/containers/libpod/cmd/podman/shared" "github.com/containers/libpod/cmd/podman/varlink" "github.com/containers/libpod/libpod" + "github.com/containers/libpod/pkg/adapter/shortcuts" cc "github.com/containers/libpod/pkg/spec" "github.com/containers/storage/pkg/archive" "github.com/pkg/errors" @@ -60,6 +61,21 @@ func (i *LibpodAPI) GetContainer(call iopodman.VarlinkCall, id string) error { return call.ReplyGetContainer(makeListContainer(ctr.ID(), batchInfo)) } +// GetContainersByContext returns a slice of container ids based on all, latest, or a list +func (i *LibpodAPI) GetContainersByContext(call iopodman.VarlinkCall, all, latest bool, input []string) error { + var ids []string + + ctrs, err := shortcuts.GetContainersByContext(all, latest, input, i.Runtime) + if err != nil { + return call.ReplyErrorOccurred(err.Error()) + } + + for _, c := range ctrs { + ids = append(ids, c.ID()) + } + return call.ReplyGetContainersByContext(ids) +} + // InspectContainer ... func (i *LibpodAPI) InspectContainer(call iopodman.VarlinkCall, name string) error { ctr, err := i.Runtime.LookupContainer(name) |