summaryrefslogtreecommitdiff
path: root/cmd/podmanV2/utils
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-21 13:47:07 -0500
committerBrent Baude <bbaude@redhat.com>2020-03-22 13:24:45 -0500
commit9536560b4f3a38fbba4ac61c357dd3627fb6cf4e (patch)
tree8d8cf1471d590752357f06088044d1dcf752ee70 /cmd/podmanV2/utils
parent2ffff3c6abacad855ce7ddf8290514ebe1424d7f (diff)
downloadpodman-9536560b4f3a38fbba4ac61c357dd3627fb6cf4e.tar.gz
podman-9536560b4f3a38fbba4ac61c357dd3627fb6cf4e.tar.bz2
podman-9536560b4f3a38fbba4ac61c357dd3627fb6cf4e.zip
podmanv2 add core container commands
add core container commands for podmanv2: kill, pause, restart, rm, stop, unpause Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podmanV2/utils')
-rw-r--r--cmd/podmanV2/utils/error.go16
-rw-r--r--cmd/podmanV2/utils/remote.go10
2 files changed, 26 insertions, 0 deletions
diff --git a/cmd/podmanV2/utils/error.go b/cmd/podmanV2/utils/error.go
new file mode 100644
index 000000000..3464f0779
--- /dev/null
+++ b/cmd/podmanV2/utils/error.go
@@ -0,0 +1,16 @@
+package utils
+
+import "fmt"
+
+type OutputErrors []error
+
+func (o OutputErrors) PrintErrors() (lastError error) {
+ if len(o) == 0 {
+ return
+ }
+ lastError = o[len(o)-1]
+ for e := 0; e < len(o)-1; e++ {
+ fmt.Println(o[e])
+ }
+ return
+}
diff --git a/cmd/podmanV2/utils/remote.go b/cmd/podmanV2/utils/remote.go
new file mode 100644
index 000000000..d0c8a272d
--- /dev/null
+++ b/cmd/podmanV2/utils/remote.go
@@ -0,0 +1,10 @@
+package utils
+
+import (
+ "github.com/containers/libpod/cmd/podmanV2/registry"
+ "github.com/containers/libpod/pkg/domain/entities"
+)
+
+func IsRemote() bool {
+ return registry.EngineOpts.EngineMode == entities.TunnelMode
+}