summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi/shortcuts.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-11-18 16:12:33 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-11-26 16:50:42 -0500
commitf62a356515e387b0bbcf1f08b4831d139c2039b7 (patch)
treea82c68f0da2e86798d7974476c865ff208cc3e8b /pkg/varlinkapi/shortcuts.go
parentad2439264d401af0443be564ccc68169a8517db4 (diff)
downloadpodman-f62a356515e387b0bbcf1f08b4831d139c2039b7.tar.gz
podman-f62a356515e387b0bbcf1f08b4831d139c2039b7.tar.bz2
podman-f62a356515e387b0bbcf1f08b4831d139c2039b7.zip
Remove varlink support from Podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/varlinkapi/shortcuts.go')
-rw-r--r--pkg/varlinkapi/shortcuts.go66
1 files changed, 0 insertions, 66 deletions
diff --git a/pkg/varlinkapi/shortcuts.go b/pkg/varlinkapi/shortcuts.go
deleted file mode 100644
index bfb05c0e3..000000000
--- a/pkg/varlinkapi/shortcuts.go
+++ /dev/null
@@ -1,66 +0,0 @@
-package varlinkapi
-
-import (
- "github.com/containers/podman/v2/libpod"
- "github.com/sirupsen/logrus"
-)
-
-// getPodsByContext returns a slice of pods. Note that all, latest and pods are
-// mutually exclusive arguments.
-func getPodsByContext(all, latest bool, pods []string, runtime *libpod.Runtime) ([]*libpod.Pod, error) {
- var outpods []*libpod.Pod
- if all {
- return runtime.GetAllPods()
- }
- if latest {
- p, err := runtime.GetLatestPod()
- if err != nil {
- return nil, err
- }
- outpods = append(outpods, p)
- return outpods, nil
- }
- var err error
- for _, p := range pods {
- pod, e := runtime.LookupPod(p)
- if e != nil {
- // Log all errors here, so callers don't need to.
- logrus.Debugf("Error looking up pod %q: %v", p, e)
- if err == nil {
- err = e
- }
- } else {
- outpods = append(outpods, pod)
- }
- }
- return outpods, err
-}
-
-// getContainersByContext gets pods whether all, latest, or a slice of names/ids
-// is specified.
-func getContainersByContext(all, latest bool, names []string, runtime *libpod.Runtime) (ctrs []*libpod.Container, err error) {
- var ctr *libpod.Container
- ctrs = []*libpod.Container{}
-
- switch {
- case all:
- ctrs, err = runtime.GetAllContainers()
- case latest:
- ctr, err = runtime.GetLatestContainer()
- ctrs = append(ctrs, ctr)
- default:
- for _, n := range names {
- ctr, e := runtime.LookupContainer(n)
- if e != nil {
- // Log all errors here, so callers don't need to.
- logrus.Debugf("Error looking up container %q: %v", n, e)
- if err == nil {
- err = e
- }
- } else {
- ctrs = append(ctrs, ctr)
- }
- }
- }
- return
-}