Add docker transport to push image before final failure

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #42
Approved by: rhatdan
This commit is contained in:
TomSweeneyRedHat
2017-11-14 09:55:00 -05:00
committed by Atomic Bot
parent da44ec438d
commit d43f786728
4 changed files with 45 additions and 13 deletions

View File

@ -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, "://")
}