diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-10 08:51:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-10 08:51:26 -0700 |
commit | 1fb0a09591ae86b659dc87bd9e3f7fe29d8add8d (patch) | |
tree | 0f9df726674f9a28abbd08fc2aa9bfb71509ec1e /pkg/varlinkapi/containers.go | |
parent | 1701707dad4e4dba9d4331bd8917be28d138254d (diff) | |
parent | fbcda7772d9fb7667be3a26fbabea0a7b5ea9a58 (diff) | |
download | podman-1fb0a09591ae86b659dc87bd9e3f7fe29d8add8d.tar.gz podman-1fb0a09591ae86b659dc87bd9e3f7fe29d8add8d.tar.bz2 podman-1fb0a09591ae86b659dc87bd9e3f7fe29d8add8d.zip |
Merge pull request #2874 from baude/varlinkterm
Add the ability to attach remotely to a container
Diffstat (limited to 'pkg/varlinkapi/containers.go')
-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 816a72953..17792ccfe 100644 --- a/pkg/varlinkapi/containers.go +++ b/pkg/varlinkapi/containers.go @@ -634,6 +634,22 @@ func (i *LibpodAPI) GetContainerStatsWithHistory(call iopodman.VarlinkCall, prev return call.ReplyGetContainerStatsWithHistory(cStats) } +// Spec ... +func (i *LibpodAPI) Spec(call iopodman.VarlinkCall, name string) error { + ctr, err := i.Runtime.LookupContainer(name) + if err != nil { + return call.ReplyErrorOccurred(err.Error()) + } + + spec := ctr.Spec() + b, err := json.Marshal(spec) + if err != nil { + return call.ReplyErrorOccurred(err.Error()) + } + + return call.ReplySpec(string(b)) +} + // GetContainersLogs is the varlink endpoint to obtain one or more container logs func (i *LibpodAPI) GetContainersLogs(call iopodman.VarlinkCall, names []string, follow, latest bool, since string, tail int64, timestamps bool) error { var wg sync.WaitGroup |