cockroachdb / terraform-provider-cockroach

Terraform provider for CockroachDB Cloud
Apache License 2.0
55 stars 10 forks source link

Check both IsNull and IsUnknown in plan #154

Closed erademacher closed 11 months ago

erademacher commented 11 months ago

Previously, we used the config instead of the plan for create and update operations and were able to simply check for null values. Now we use the plan, but that means we need to check if values are either null or unknown.

This change adds a utility method that checks both. Replaced all references to both states, since in all existing cases, we want to treat them the same.

Refactored the cluster resource integration tests to allow any number of GetCluster calls and return the latest iteration of the cluster after UpdateCluster mutates it.

This fixes issue #152.

Commit checklist

erademacher commented 11 months ago

TFTR!