digitalocean / terraform-provider-digitalocean

Terraform DigitalOcean provider
https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs
Mozilla Public License 2.0
510 stars 278 forks source link

opensearch_config: only send PATCH on create if values set. #1268

Closed andrewsomething closed 1 week ago

andrewsomething commented 1 week ago

As reported in https://github.com/digitalocean/terraform-provider-digitalocean/issues/1266, "creating" a digitalocean_database_opensearch_config without any setting leads to an error. This change protects against that by preventing sending the PATCH on create if no other values beside cluster_id are set.

Additionally, I ran into some issue running the acceptance test. One is a bug. We need to use GetOkExists when checking the value for a bool. If not, it is not correctly detected when being set to false.

There are also a few changes to the test that do not impact functionality which I will note inline.