From 06b830546182674ae3c404090c253bd81c89b596 Mon Sep 17 00:00:00 2001 From: The Magician Date: Thu, 15 Sep 2022 06:52:53 -0700 Subject: [PATCH] updated field name (#6550) (#12566) Co-authored-by: Edward Sun Signed-off-by: Modular Magician Signed-off-by: Modular Magician Co-authored-by: Edward Sun --- .changelog/6550.txt | 3 +++ google/resource_compute_per_instance_config.go | 4 ++-- google/resource_compute_region_per_instance_config.go | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changelog/6550.txt diff --git a/.changelog/6550.txt b/.changelog/6550.txt new file mode 100644 index 00000000000..0436bda4218 --- /dev/null +++ b/.changelog/6550.txt @@ -0,0 +1,3 @@ +```release-note:bug +compute: fixed unable to update `most_disruptive_allowed_action` for both `google_compute_per_instance_config` and `google_compute_region_per_instance_config` +``` diff --git a/google/resource_compute_per_instance_config.go b/google/resource_compute_per_instance_config.go index 07605bf0a8d..0483a84c683 100644 --- a/google/resource_compute_per_instance_config.go +++ b/google/resource_compute_per_instance_config.go @@ -381,8 +381,8 @@ func resourceComputePerInstanceConfigUpdate(d *schema.ResourceData, meta interfa } obj["minimalAction"] = minAction - mostDisruptiveAction := d.Get("most_disruptive_action_allowed") - if mostDisruptiveAction != "" { + mostDisruptiveAction := d.Get("most_disruptive_allowed_action") + if isEmptyValue(reflect.ValueOf(mostDisruptiveAction)) { mostDisruptiveAction = "REPLACE" } obj["mostDisruptiveActionAllowed"] = mostDisruptiveAction diff --git a/google/resource_compute_region_per_instance_config.go b/google/resource_compute_region_per_instance_config.go index fa32ada3008..322ef02ed35 100644 --- a/google/resource_compute_region_per_instance_config.go +++ b/google/resource_compute_region_per_instance_config.go @@ -390,8 +390,8 @@ func resourceComputeRegionPerInstanceConfigUpdate(d *schema.ResourceData, meta i } obj["minimalAction"] = minAction - mostDisruptiveAction := d.Get("most_disruptive_action_allowed") - if mostDisruptiveAction != "" { + mostDisruptiveAction := d.Get("most_disruptive_allowed_action") + if isEmptyValue(reflect.ValueOf(mostDisruptiveAction)) { mostDisruptiveAction = "REPLACE" } obj["mostDisruptiveActionAllowed"] = mostDisruptiveAction