Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more flexible nested types #31

Merged
merged 12 commits into from
Dec 8, 2024
Merged

Allow more flexible nested types #31

merged 12 commits into from
Dec 8, 2024

Conversation

kwohlfahrt
Copy link
Owner

This effectively side-steps the entire Terraform type-system. The issue is that in Terraform, a list containing DynamicValue, still has to have all of the dynamic values reconcilable to the same type. This doesn't apply to x-kubernetes-int-or-string, though there it can be worked around by converting all to string. However, with more complicated types that are x-kubernetes-preserve-unknown-fields, this will not be possible.

Therefore, make everything dynamic, and handle checking ourselves. The one downside is that IDE integrations etc can't use the schema types for type-hints.

This may be worth revisiting when github.com/hashicorp/terraform#33916 is resolved.

This effectively side-steps the entire Terraform type-system. The issue
is that in Terraform, a list containing `DynamicValue`, still has to
have all of the dynamic values reconcilable to the same type. This
doesn't apply to `x-kubernetes-int-or-string`, though there it can be
worked around by converting all to string. However, with more
complicated types that are `x-kubernetes-preserve-unknown-fields`, this
will not be possible.

Therefore, make everything dynamic, and handle checking ourselves. The
one downside is that IDE integrations etc can't use the schema types for
type-hints.

This may be worth revisiting when github.com/hashicorp/terraform#33916
is resolved.
We need to instantiate partial manifests in some places, notably after
the first phase of import. However, when setting the state, the full
value validation triggers, which rejects the partial update.

Attribute validation only triggers when ingesting the config, which
works out here.
@kwohlfahrt kwohlfahrt merged commit 1d4656e into main Dec 8, 2024
10 checks passed
@kwohlfahrt kwohlfahrt deleted the ports branch December 8, 2024 23:10
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