direct: Fix cluster recreate if apply_policy_default_values is set; auto handle fields not in remote type#5693
Merged
Merged
Conversation
…g manual ignore_remote_changes entries Fields accepted by the API on write but not returned by GET (e.g. apply_policy_default_values on clusters) always appear nil in remote state, causing spurious drift after every deploy. Add automatic suppression: if a field is present in StateType but absent from RemoteType and there is no local change (old == new), skip it with reason missing_in_remote. Local changes (old != new) still fall through to update or recreate as normal. Add a test that rejects manual ignore_remote_changes entries in resources.yml for fields already covered by the automatic rule, and remove the nine entries that became redundant. Co-authored-by: Isaac
Collaborator
Integration test reportCommit: 2c3b27c
|
…ee resources For vector_search_endpoints, secret_scopes, and model_serving_endpoints, fields that the API returns under a different name were being mapped in RemapState. This made them appear absent from RemoteType, causing the new missing_in_remote suppression to hide real drift. Fix: extend RemoteType with the state-compatible field names and do the mapping in DoRead/newXxxRemote instead. RemapState becomes a direct copy. Co-authored-by: Isaac
Co-authored-by: Isaac
secret_scope.go reverted: field mapping between InputType/StateType names makes the RemoteType fix non-trivial (reference resolution needs InputType names; drift detection needs StateType names). Will address separately. Acceptance output updates are correct new behavior from this PR: - model_serving_endpoints: remote_state now includes flattened fields - quality_monitors: warehouse_id/skip_builtin_dashboard reason changes from "input_only" (manual resources.yml) to "missing_in_remote" (auto) Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
pietern
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Tests
New invariant test specifically reproducing apply_policy_default_values issue.