databricks / terraform-provider-databricks

Databricks Terraform Provider
https://registry.terraform.io/providers/databricks/databricks/latest
Other
456 stars 393 forks source link

[Fix] Use cluster list API to determine pinned cluster status #4203

Closed bgrams closed 1 week ago

bgrams commented 1 week ago

Changes

Modify setPinnedStatus to use the clusters list API internally for determining the pinning status of a cluster. The existing implementation using the cluster events API subjects the resource to drift as events expire after a period of time.

Closes #3616

Tests

github-actions[bot] commented 1 week ago

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger: go/deco-tests-run/terraform

Inputs:

Checks will be approved automatically on success.

alexott commented 1 week ago

@bgrams I'm really thinking if we even need to use any additional APIs. I now see that pinned clusters have the non-emptypinned_by_user_name field. I need to clarify with the clusters team if it's enough...

bgrams commented 1 week ago

Oh, that would be convenient. I don't see this field in the API docs or CLI output. Lmk and I can adapt this PR if needed.

bgrams commented 1 week ago

Thanks! Will these run automatically or is manual action required?

alexott commented 1 week ago

I'll run them when we fix one of the environments where tests are currently failing

eng-dev-ecosystem-bot commented 1 week ago

Test Details: go/deco-tests/11793935188