From 1f8dc3fa7458441561b24ea97861b5d0f3aaa681 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 23 Oct 2020 21:45:02 +0000 Subject: [PATCH] Apply dsf to google_compute_health_check port value with no portspec (#4143) Signed-off-by: Modular Magician --- .changelog/4143.txt | 3 +++ google-beta/resource_compute_health_check.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/4143.txt diff --git a/.changelog/4143.txt b/.changelog/4143.txt new file mode 100644 index 0000000000..737c38732d --- /dev/null +++ b/.changelog/4143.txt @@ -0,0 +1,3 @@ +```release-note:bug +compute: fixed an issue where `google_compute_health_check` `port` values caused a diff when `port_specification` was unset or set to `""` +``` diff --git a/google-beta/resource_compute_health_check.go b/google-beta/resource_compute_health_check.go index a1740b44c0..bd0bb880f3 100644 --- a/google-beta/resource_compute_health_check.go +++ b/google-beta/resource_compute_health_check.go @@ -101,7 +101,7 @@ func portDiffSuppress(k, old, new string, d *schema.ResourceData) bool { newPort, _ := strconv.Atoi(new) portSpec := d.Get(b[0] + ".0.port_specification") - if int64(oldPort) == defaultPort && newPort == 0 && portSpec == "USE_FIXED_PORT" { + if int64(oldPort) == defaultPort && newPort == 0 && (portSpec == "USE_FIXED_PORT" || portSpec == "") { return true } }