Adding a "data" block to a "check" stores the data in the state #1490
Labels
bug
Something isn't working
pending-decision
This issue has not been accepted for implementation nor rejected. It's still open to discussion.
OpenTofu Version
OpenTofu Configuration Files
Debug Output
(none needed, there's nothing going wrong)
Expected Behavior
As the data is only used during the checking/assertion, I would assume the data lived in memory for the time needed and was discarded afterwards. There is no way to assess the
checks
afterwards, as there is notofu check
aliketofu output
... (this would be a good addition btw).Actual Behavior
The data is saved to the state. This seems wrong to me, as the data is only used during the checks, and is useless afterwards.
In this specific case, this results in a new state change on every plan/apply, as the data from "kubernetes_resources" with the specific selectors is changing very often (due to kubernetes scaling, kubernetes-state changes...).
Steps to Reproduce
Use the above check against a recent kubernetes cluster, and apply a couple of times. Each run gives differences on the data object.
Additional Context
none
References
none
The text was updated successfully, but these errors were encountered: