From 01f3a455301c04d8cc64de3f996140c5d3509526 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Thu, 19 Nov 2015 11:18:36 +0100 Subject: [PATCH 1/3] Update default google image Signed-off-by: David Gageot --- docs/drivers/gce.md | 4 ++-- drivers/google/google.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/drivers/gce.md b/docs/drivers/gce.md index a23ba91be3..28050ca591 100644 --- a/docs/drivers/gce.md +++ b/docs/drivers/gce.md @@ -53,7 +53,7 @@ $ docker-machine create --driver google \ - `--google-tags`: Instance tags (comma-separated). - `--google-use-internal-ip`: When this option is used during create it will make docker-machine use internal rather than public NATed IPs. The flag is persistent in the sense that a machine created with it retains the IP. It's useful for managing docker machines from another machine on the same network e.g. while deploying swarm. -The GCE driver will use the `ubuntu-1404-trusty-v20150909a` instance image unless otherwise specified. To obtain a +The GCE driver will use the `ubuntu-1404-trusty-v20151113` instance image unless otherwise specified. To obtain a list of image URLs run: ``` gcloud compute images list --uri @@ -66,7 +66,7 @@ Environment variables and default values: | **`--google-project`** | `GOOGLE_PROJECT` | - | | `--google-zone` | `GOOGLE_ZONE` | `us-central1-a` | | `--google-machine-type` | `GOOGLE_MACHINE_TYPE` | `f1-standard-1` | -| `--google-machine-image` | `GOOGLE_MACHINE_IMAGE` | `ubuntu-1404-trusty-v20150909a` | +| `--google-machine-image` | `GOOGLE_MACHINE_IMAGE` | `ubuntu-1404-trusty-v20151113` | | `--google-username` | `GOOGLE_USERNAME` | `docker-user` | | `--google-scopes` | `GOOGLE_SCOPES` | `devstorage.read_only,logging.write` | | `--google-disk-size` | `GOOGLE_DISK_SIZE` | `10` | diff --git a/drivers/google/google.go b/drivers/google/google.go index c82527b263..ef36debd5d 100644 --- a/drivers/google/google.go +++ b/drivers/google/google.go @@ -32,7 +32,7 @@ const ( defaultZone = "us-central1-a" defaultUser = "docker-user" defaultMachineType = "n1-standard-1" - defaultImageName = "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20150909a" + defaultImageName = "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20151113" defaultScopes = "https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write" defaultDiskType = "pd-standard" defaultDiskSize = 10 From 5aa2179807e9cf63718777dc06e5cc2abe9bbffa Mon Sep 17 00:00:00 2001 From: David Gageot Date: Thu, 19 Nov 2015 11:23:55 +0100 Subject: [PATCH 2/3] GetURL() should fail is the machine is stopped Signed-off-by: David Gageot --- drivers/google/google.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/google/google.go b/drivers/google/google.go index ef36debd5d..ac0f094b73 100644 --- a/drivers/google/google.go +++ b/drivers/google/google.go @@ -229,10 +229,19 @@ func (d *Driver) GetURL() (string, error) { // GetIP returns the IP address of the GCE instance. func (d *Driver) GetIP() (string, error) { + machineState, err := d.GetState() + if err != nil { + return "", err + } + if machineState != state.Running { + return "", drivers.ErrHostIsNotRunning + } + c, err := newComputeUtil(d) if err != nil { return "", err } + return c.ip() } From 71f82e86b1ee97aacebec3d33e254e83d225c1aa Mon Sep 17 00:00:00 2001 From: David Gageot Date: Thu, 19 Nov 2015 11:48:29 +0100 Subject: [PATCH 3/3] Fix Typo Signed-off-by: David Gageot --- drivers/google/google.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/google/google.go b/drivers/google/google.go index ac0f094b73..9daada4846 100644 --- a/drivers/google/google.go +++ b/drivers/google/google.go @@ -181,7 +181,7 @@ func (d *Driver) PreCreateCheck() error { return err } - // Check that the project exists. It will also check that credentials + // Check that the project exists. It will also check the credentials // at the same time. log.Infof("Check that the project exists")