diff --git a/builtin/providers/google/resource_compute_disk.go b/builtin/providers/google/resource_compute_disk.go index 294f65479..c577ad298 100644 --- a/builtin/providers/google/resource_compute_disk.go +++ b/builtin/providers/google/resource_compute_disk.go @@ -204,7 +204,7 @@ func resourceComputeDiskUpdate(d *schema.ResourceData, meta interface{}) error { } } - return nil + return resourceComputeDiskRead(d, meta) } func resourceComputeDiskRead(d *schema.ResourceData, meta interface{}) error { @@ -259,10 +259,7 @@ func resourceComputeDiskRead(d *schema.ResourceData, meta interface{}) error { imageUrlParts := strings.Split(disk.SourceImage, "/") d.Set("image", imageUrlParts[len(imageUrlParts)-1]) } - if disk.SourceSnapshot != "" { - snapshotUrlParts := strings.Split(disk.SourceSnapshot, "/") - d.Set("snapshot", snapshotUrlParts[len(snapshotUrlParts)-1]) - } + d.Set("snapshot", disk.SourceSnapshot) return nil } diff --git a/builtin/providers/google/resource_compute_disk_test.go b/builtin/providers/google/resource_compute_disk_test.go index 28288a811..2583c8e96 100644 --- a/builtin/providers/google/resource_compute_disk_test.go +++ b/builtin/providers/google/resource_compute_disk_test.go @@ -304,7 +304,7 @@ resource "google_compute_instance" "bar" { zone = "us-central1-a" disk { - image = "debian-8" + image = "debian-8-jessie-v20170523" } disk {