summaryrefslogtreecommitdiff
path: root/cmd/podmanV2/utils
diff options
context:
space:
mode:
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
+}