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

fix(provisioner/terraform/tfparse): evaluate coder_parameter defaults with variables#15800

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

Merged
johnstcn merged 3 commits intomainfromcj/gh15795-tfparse-dynamic-default-value
Dec 10, 2024

Conversation

johnstcn
Copy link
Member

Relates to#15795

Previously we had not been evaluating the default value of acoder_parameter before extracting the tags. This PR adds support for dynamic default values from a variable.
It does not add support for 'chaining' parameter default values, as I could imagine us ending up in a situation where we have a cyclic dependency.

@johnstcnjohnstcn self-assigned thisDec 9, 2024
defaultsM[dataResource.Name] = strings.Trim(value, `"`)
// Issue #15795: the "default" value could also be an expression we need
// to evaluate.
// TODO: should we support coder_parameter default values that reference other coder_parameter data sources?
Copy link
Member

Choose a reason for hiding this comment

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

Has there been an ask? If not, we can probably defer it until such a time. It's best to be careful how much we expand the scope of these expressions.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm not aware of any ask for this just yet. I'd much prefer to defer it as it opens up several cans of worms.

Copy link
Member

Choose a reason for hiding this comment

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

It is sort of a FIXME :)

resource "foo_bar" "baz" {}
variable "region" {
type = string
default = "us"
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember the current bevahior, so let me ask -
how this solution will perform if we have a variable without a default value? AFAIR Coder should require to input the value for variable.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Correct, if there is no default value we will fail this 'preflight' check with an error. This only happens if you're using thecoder_workspace_tags data source.

mtojek reacted with thumbs up emoji
defaultsM[dataResource.Name] = strings.Trim(value, `"`)
// Issue #15795: the "default" value could also be an expression we need
// to evaluate.
// TODO: should we support coder_parameter default values that reference other coder_parameter data sources?
Copy link
Member

Choose a reason for hiding this comment

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

It is sort of a FIXME :)

@johnstcnjohnstcn merged commit7dc3ad9 intomainDec 10, 2024
33 checks passed
@johnstcnjohnstcn deleted the cj/gh15795-tfparse-dynamic-default-value branchDecember 10, 2024 10:58
stirby pushed a commit that referenced this pull requestDec 11, 2024
… with variables (#15800)- adds support for dynamic default values in coder_parameter data source(cherry picked from commit7dc3ad9)
aslilac pushed a commit that referenced this pull requestDec 11, 2024
… with variables (#15800)- adds support for dynamic default values in coder_parameter data source
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mafredrimafredrimafredri approved these changes

@mtojekmtojekmtojek approved these changes

@angrycubangrycubAwaiting requested review from angrycub

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@johnstcn@mafredri@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp