Implement majority of provisioning changes
Signed-off-by: Simon Thulborn <simon+github@thulborn.com> Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
committed by
Nathan LeClaire
parent
8d5a59b43e
commit
49feb33457
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
@@ -95,6 +96,18 @@ func WaitFor(f func() bool) error {
|
||||
return WaitForSpecific(f, 60, 3*time.Second)
|
||||
}
|
||||
|
||||
func WaitForDocker(ip string, daemonPort int) error {
|
||||
return WaitFor(func() bool {
|
||||
conn, err := net.Dial("tcp", fmt.Sprintf("%s:%d", ip, daemonPort))
|
||||
if err != nil {
|
||||
fmt.Println("Got an error it was", err)
|
||||
return false
|
||||
}
|
||||
conn.Close()
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
func DumpVal(vals ...interface{}) {
|
||||
for _, val := range vals {
|
||||
prettyJSON, err := json.MarshalIndent(val, "", " ")
|
||||
|
||||
Reference in New Issue
Block a user