Skip to content

Commit 83a40bd

Browse files
Handle compute instance not found crash (#5955) (#4262)
Signed-off-by: Modular Magician <[email protected]>
1 parent 429f597 commit 83a40bd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.changelog/5955.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
compute: fixed a crash when `compute.instance` is not found
3+
```

google-beta/resource_compute_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ func resourceComputeInstanceUpdate(d *schema.ResourceData, meta interface{}) err
14191419
// Change back to getInstance(config, d) once updating alias ips is GA.
14201420
instance, err := config.NewComputeClient(userAgent).Instances.Get(project, zone, d.Get("name").(string)).Do()
14211421
if err != nil {
1422-
return handleNotFoundError(err, d, fmt.Sprintf("Instance %s", instance.Name))
1422+
return handleNotFoundError(err, d, fmt.Sprintf("Instance %s", d.Get("name").(string)))
14231423
}
14241424

14251425
// Enable partial mode for the resource since it is possible

0 commit comments

Comments
 (0)