fix: env data sources crash with timeouts conversion error - #263
Open
ianaya89 wants to merge 1 commit into
Open
Conversation
The env data sources read into the resource model, which carries the resource-only `timeouts` block. The framework requires an exact struct/schema match, so every read failed with "Struct defines fields not found in object: timeouts". Affects all five env data sources (aws, gcp, azure, k8s, hcloud). Regression from #220, shipped in v0.6.0. Shared attributes now live in an embedded base model, with separate resource (base + timeouts) and data source (base) models. Schemas are unchanged. Adds schema/model consistency tests for every env resource and data source; they fail on master with the exact production error.
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.
Fixes
Value Conversion Error: mismatch between struct and object: Struct defines fields not found in object: timeoutson every read of an env data source (Altinity/cloud#1806). Affects all five —altinitycloud_env_aws,_gcp,_azure,_k8s,_hcloud— not just AWS. Regression from #220, shipped in v0.6.0.Root cause: the data sources read into the resource model, which carries the resource-only
timeoutsblock. The plugin framework requires an exact struct/schema match in both directions, so the read fails before any API call.Fix: shared attributes move to an embedded base model, with separate resource (base +
timeouts) and data source (base) models. Field/method promotion keeps every call site unchanged, and the schemas — so the docs — are untouched.Also adds schema/model consistency tests for every env resource and data source. They fail on master with the exact production error; the existing acceptance test covers this path but only runs manually.