mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
providers/google: partial updates with compute_instance
This commit is contained in:
parent
87a488092c
commit
bfbb9201c4
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user