Skip to content

fix: env data sources crash with timeouts conversion error - #263

Open
ianaya89 wants to merge 1 commit into
masterfrom
fix/env-data-source-timeouts-model
Open

fix: env data sources crash with timeouts conversion error#263
ianaya89 wants to merge 1 commit into
masterfrom
fix/env-data-source-timeouts-model

Conversation

@ianaya89

@ianaya89 ianaya89 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Fixes Value Conversion Error: mismatch between struct and object: Struct defines fields not found in object: timeouts on 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 timeouts block. 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.

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.
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