Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DNM: hack: terraform-plugin-framework and dynamic types#354

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
johnstcn wants to merge4 commits intomain
base:main
Choose a base branch
Loading
fromcj/hack/parameter-dynamic-type

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedFeb 28, 2025
edited
Loading

  • using mux server to serve both old and new provider implementations
  • some mucking around withdynamic types for coder parameter

matifali and stirby reacted with heart emoji
@johnstcnjohnstcn self-assigned thisFeb 28, 2025
@Emyrk
Copy link
Member

Emyrk commentedMar 3, 2025
edited
Loading

I see type constraint values might still not be supported? So

data"coder_parameter""test" {type=string// Not allowedtype="string"// is allowed

It treatsstring as a reference, rather than a type constraint. This does check out though, as type constraints are treated as keywords. And keywords in expressions are just traversals.

See traversal to keyword:https://github.com/hashicorp/hcl/blob/main/traversal_for_expr.go#L70-L127
And how they parse the keyword to a type:https://github.com/hashicorp/terraform/blob/main/internal/stacks/stackconfig/typeexpr/typeexpr.go#L27-L31

And on the input value:https://github.com/hashicorp/terraform/blob/main/internal/stacks/stackconfig/input_variable.go#L20-L21 (var blocks are input variables)

So type constraints are just references. We might have to keep our types as quoted strings? 😢

Traversals less than 2 are considered invalid too? I am not sure where this error is raised, but it is raised somewhere by the tests. I do see where this is enforce in tflint, which I assume has some parity with terraform.

A reference to a resource type must be followed by at least one attribute        access, specifying the resource name.

TFLint:https://github.com/terraform-linters/tflint-plugin-sdk/blob/master/terraform/addrs/parse_ref.go#L231

@johnstcn
Copy link
MemberAuthor

Traversals less than 2 are considered invalid too?

I think that's just for a resource, which is alwaysresource_type.name. SeeparseRef for other kinds of traversalshttps://github.com/terraform-linters/tflint-plugin-sdk/blob/master/terraform/addrs/parse_ref.go#L66

@Emyrk
Copy link
Member

Another issue with the current sdk.

#123

The current does not support pointer types? So we have to compute some helper fields?

@Emyrk
Copy link
Member

Emyrk commentedMar 17, 2025
edited
Loading

Relevent:coder/preview#94

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@johnstcn@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp