Skip to content

direct: keep the state entry when an update empties a resource - #6456

Draft
shreyas-goenka wants to merge 1 commit into
mainfrom
isaac/empty-state-keeps-entry
Draft

direct: keep the state entry when an update empties a resource#6456
shreyas-goenka wants to merge 1 commit into
mainfrom
isaac/empty-state-keeps-entry

Conversation

@shreyas-goenka

Copy link
Copy Markdown
Contributor

An update that empties a resource dropped its state entry, so the next plan saw no state and an empty config, skipped the node, and never compared it against the remote. grants: [] therefore revoked once and then stopped enforcing: add a grant out of band afterwards and it survived every later deploy.

Saving the empty state keeps the node planned, so the remote is compared each time and the list stays enforced. New test grants/schemas/empty_list_enforced covers that out-of-band case on cloud.

Terraform has the same hole and is unchanged here, so the two goldens it affects are per-engine now.

This pull request and its description were written by Isaac.

An update that emptied a resource dropped its state entry. The next plan then saw no state
and an empty config, skipped the node, and never compared it against the remote - so
`grants: []` revoked once and stopped enforcing. Add a grant out of band afterwards and it
survived every later deploy.

Saving the empty state keeps the node planned, so the remote is compared each time and the
list stays enforced. The resource is still there: the schema keeps existing, it just grants
nothing.

Terraform has the same hole and is left as is, so remove_all's plan output and the new
test's grants read are per-engine now.

Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant