mirror of https://github.com/docker/docs.git
Merge pull request #11 from bfirsh/cloud-backend-fixes
This commit is contained in:
commit
b69fb4ec3b
|
@ -83,7 +83,7 @@ func (s *cloud) Install(eng *engine.Engine) error {
|
||||||
}
|
}
|
||||||
cloud, err = NewCloudGCE(job.Args[3])
|
cloud, err = NewCloudGCE(job.Args[3])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
job.Errorf("Unexpected error: %#v", err)
|
return job.Errorf("Unexpected error: %#v", err)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return job.Errorf("Unknown cloud provider: %s", job.Args[0])
|
return job.Errorf("Unknown cloud provider: %s", job.Args[0])
|
||||||
|
@ -91,11 +91,11 @@ func (s *cloud) Install(eng *engine.Engine) error {
|
||||||
ip, err := cloud.GetPublicIPAddress(instance, zone)
|
ip, err := cloud.GetPublicIPAddress(instance, zone)
|
||||||
instanceRunning := len(ip) > 0
|
instanceRunning := len(ip) > 0
|
||||||
if !instanceRunning {
|
if !instanceRunning {
|
||||||
log.Print("Instance doesn't exist, creating....");
|
log.Print("Instance doesn't exist, creating....")
|
||||||
_, err = cloud.CreateInstance(instance, zone)
|
_, err = cloud.CreateInstance(instance, zone)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
job.Errorf("Unexpected error: %#v", err)
|
return job.Errorf("Unexpected error: %#v", err)
|
||||||
}
|
}
|
||||||
remotePort := 8000
|
remotePort := 8000
|
||||||
localPort := 8001
|
localPort := 8001
|
||||||
|
@ -110,13 +110,13 @@ func (s *cloud) Install(eng *engine.Engine) error {
|
||||||
fmt.Printf("Creating tunnel")
|
fmt.Printf("Creating tunnel")
|
||||||
_, err = cloud.OpenSecureTunnel(instance, zone, localPort, remotePort)
|
_, err = cloud.OpenSecureTunnel(instance, zone, localPort, remotePort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
job.Errorf("Failed to open tunnel: %#v", err)
|
return job.Errorf("Failed to open tunnel: %#v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
host := fmt.Sprintf("tcp://localhost:%d", localPort)
|
host := fmt.Sprintf("tcp://localhost:%d", localPort)
|
||||||
client, err := newClient(host, apiVersion)
|
client, err := newClient(host, apiVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
job.Errorf("Unexpected error: %#v", err)
|
return job.Errorf("Unexpected error: %#v", err)
|
||||||
}
|
}
|
||||||
//job.Eng.Register("inspect", func(job *engine.Job) engine.Status {
|
//job.Eng.Register("inspect", func(job *engine.Job) engine.Status {
|
||||||
// resp, err := client.call("GET", "/containers/
|
// resp, err := client.call("GET", "/containers/
|
||||||
|
|
Loading…
Reference in New Issue