Skip to content

fix: allow array output type in tfstate outputs#1373

Merged
georgidimdimitrov merged 10 commits intocloudfoundry:mainfrom
AmirKelman:fix-tfstate-output-list-type
Jan 28, 2026
Merged

fix: allow array output type in tfstate outputs#1373
georgidimdimitrov merged 10 commits intocloudfoundry:mainfrom
AmirKelman:fix-tfstate-output-list-type

Conversation

@AmirKelman
Copy link
Copy Markdown
Contributor

Checklist:

  • [V ] Have you added or updated tests to validate the changed functionality?
  • [N/A] Have you added Release Notes in the docs repositories?
  • [V] Have you followed the Conventional Commits specification?

##Summary

Fix handling of Terraform state output types that are represented as arrays (e.g. ["list","string"]) instead of a single string.

##Background

Terraform/OpenTofu may serialize tfstate.outputs[*].type as a JSON array for composite types.
The existing implementation assumed this field was always a string, which caused state parsing to fail when array-based types were encountered.

This issue was reported in #1279 .

##Changes

Allow tfstate.outputs[*].type to be stored and processed as raw JSON

Update the brokerpak test framework to correctly emit array output types

Add a unit test covering array output type handling

##Impact

Backward compatible

No behavior change for existing string-typed outputs

Fixes failures when working with Terraform states containing list/object output types

##Testing

Added unit test: TestNewTfstate_AllowsArrayOutputType

Existing test suite passes for affected packages

Fixes #1279

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Jan 17, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@AmirKelman
Copy link
Copy Markdown
Contributor Author

Hi maintainers
The fix is ready and EasyCLA is now signed.
Could someone please approve the workflows so CI can run, and review when convenient?
Thanks!

Copy link
Copy Markdown
Member

@georgidimdimitrov georgidimdimitrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks ok with minor suggestions.

@AmirKelman AmirKelman changed the title Fix tfstate output list type fix: allow array output type in tfstate outputs Jan 23, 2026
@georgidimdimitrov
Copy link
Copy Markdown
Member

Suggestions are addressed now.

Copy link
Copy Markdown
Member

@georgidimdimitrov georgidimdimitrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving

@github-project-automation github-project-automation bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jan 28, 2026
@georgidimdimitrov georgidimdimitrov merged commit 61e693e into cloudfoundry:main Jan 28, 2026
7 checks passed
@github-project-automation github-project-automation bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[BUG] Provision fails when a provision output is a list type

2 participants