summaryrefslogtreecommitdiff
path: root/libpod/util.go
diff options
context:
space:
mode:
authorTomSweeneyRedHat <tsweeney@redhat.com>2017-11-14 09:55:00 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-28 12:53:25 +0000
commitd43f7867282f04d3003c44ee96eb2324c6d2a0aa (patch)
treefe4f893668d4ec72a590b9c1f44ad97417172a7f /libpod/util.go
parentda44ec438dd854dd7cd0d0eae1e37bf41cfe4929 (diff)
downloadpodman-d43f7867282f04d3003c44ee96eb2324c6d2a0aa.tar.gz
podman-d43f7867282f04d3003c44ee96eb2324c6d2a0aa.tar.bz2
podman-d43f7867282f04d3003c44ee96eb2324c6d2a0aa.zip
Add docker transport to push image before final failure
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com> Closes: #42 Approved by: rhatdan
Diffstat (limited to 'libpod/util.go')
-rw-r--r--libpod/util.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/util.go b/libpod/util.go
index 61546f23e..c8cbfa2fc 100644
--- a/libpod/util.go
+++ b/libpod/util.go
@@ -4,9 +4,17 @@ import (
"fmt"
"os"
"path/filepath"
+ "strings"
"time"
)
+// Runtime API constants
+const (
+ // DefaultTransport is a prefix that we apply to an image name
+ // to check docker hub first for the image
+ DefaultTransport = "docker://"
+)
+
// WriteFile writes a provided string to a provided path
func WriteFile(content string, path string) error {
baseDir := filepath.Dir(path)
@@ -42,3 +50,8 @@ func FuncTimer(funcName string) {
elapsed := time.Since(time.Now())
fmt.Printf("%s executed in %d ms\n", funcName, elapsed)
}
+
+// hasTransport determines if the image string contains '://', returns bool
+func hasTransport(image string) bool {
+ return strings.Contains(image, "://")
+}