Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send empty value for [region]healthcheck description #2580

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/4082.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
compute: fixed ability to clear `description` field on `google_compute_health_check` and `google_compute_region_health_check`
```
4 changes: 2 additions & 2 deletions google-beta/resource_compute_health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ func resourceComputeHealthCheckCreate(d *schema.ResourceData, meta interface{})
descriptionProp, err := expandComputeHealthCheckDescription(d.Get("description"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
} else if v, ok := d.GetOkExists("description"); ok || !reflect.DeepEqual(v, descriptionProp) {
obj["description"] = descriptionProp
}
healthyThresholdProp, err := expandComputeHealthCheckHealthyThreshold(d.Get("healthy_threshold"), d, config)
Expand Down Expand Up @@ -906,7 +906,7 @@ func resourceComputeHealthCheckUpdate(d *schema.ResourceData, meta interface{})
descriptionProp, err := expandComputeHealthCheckDescription(d.Get("description"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
} else if v, ok := d.GetOkExists("description"); ok || !reflect.DeepEqual(v, descriptionProp) {
obj["description"] = descriptionProp
}
healthyThresholdProp, err := expandComputeHealthCheckHealthyThreshold(d.Get("healthy_threshold"), d, config)
Expand Down
1 change: 0 additions & 1 deletion google-beta/resource_compute_health_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ func testAccComputeHealthCheck_tcp_update(hckName string) string {
return fmt.Sprintf(`
resource "google_compute_health_check" "foobar" {
check_interval_sec = 3
description = "Resource updated for Terraform acceptance testing"
healthy_threshold = 10
name = "health-test-%s"
timeout_sec = 2
Expand Down
4 changes: 2 additions & 2 deletions google-beta/resource_compute_region_health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ func resourceComputeRegionHealthCheckCreate(d *schema.ResourceData, meta interfa
descriptionProp, err := expandComputeRegionHealthCheckDescription(d.Get("description"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
} else if v, ok := d.GetOkExists("description"); ok || !reflect.DeepEqual(v, descriptionProp) {
obj["description"] = descriptionProp
}
healthyThresholdProp, err := expandComputeRegionHealthCheckHealthyThreshold(d.Get("healthy_threshold"), d, config)
Expand Down Expand Up @@ -838,7 +838,7 @@ func resourceComputeRegionHealthCheckUpdate(d *schema.ResourceData, meta interfa
descriptionProp, err := expandComputeRegionHealthCheckDescription(d.Get("description"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
} else if v, ok := d.GetOkExists("description"); ok || !reflect.DeepEqual(v, descriptionProp) {
obj["description"] = descriptionProp
}
healthyThresholdProp, err := expandComputeRegionHealthCheckHealthyThreshold(d.Get("healthy_threshold"), d, config)
Expand Down
1 change: 0 additions & 1 deletion google-beta/resource_compute_region_health_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ func testAccComputeRegionHealthCheck_tcp_update(hckName string) string {
return fmt.Sprintf(`
resource "google_compute_region_health_check" "foobar" {
check_interval_sec = 3
description = "Resource updated for Terraform acceptance testing"
healthy_threshold = 10
name = "health-test-%s"
timeout_sec = 2
Expand Down