From bfbb9201c4c59f8398cfcde452c89fdf6a2e8d49 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 26 Aug 2014 20:31:35 -0700 Subject: [PATCH] providers/google: partial updates with compute_instance --- builtin/providers/google/resource_compute_instance.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/builtin/providers/google/resource_compute_instance.go b/builtin/providers/google/resource_compute_instance.go index 9079c7a54..5a2d6aa18 100644 --- a/builtin/providers/google/resource_compute_instance.go +++ b/builtin/providers/google/resource_compute_instance.go @@ -321,6 +321,9 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error func resourceComputeInstanceUpdate(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) + // Enable partial mode for the resource since it is possible + d.Partial(true) + // If the Metadata has changed, then update that. if d.HasChange("metadata") { metadata := resourceInstanceMetadata(d) @@ -350,6 +353,8 @@ func resourceComputeInstanceUpdate(d *schema.ResourceData, meta interface{}) err // Return the error return OperationError(*op.Error) } + + d.SetPartial("metadata") } if d.HasChange("tags") { @@ -380,8 +385,13 @@ func resourceComputeInstanceUpdate(d *schema.ResourceData, meta interface{}) err // Return the error return OperationError(*op.Error) } + + d.SetPartial("tags") } + // We made it, disable partial mode + d.Partial(false) + return resourceComputeInstanceRead(d, meta) }