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

feat: load variables from tfvars files#11549

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
mtojek merged 19 commits intomainfrom8501-parse-tfvars-3
Jan 12, 2024
Merged

Conversation

mtojek
Copy link
Member

@mtojekmtojek commentedJan 10, 2024
edited
Loading

Fixes:#8501

This PR expands thetemplate push andtemplate create to review.tfvars and.tfvars.json files while uploading next template version. CLI will support a flat variable structure:

HCL

region="us-east-1"cores=2go_image=["1.19","1.20","1.21"]

JSON

{"region":"us-east-1","cores":2,"go_image": ["1.19","1.20","1.21"]}

TODO:

  • test: DiscoverVarsFiles
  • test: ParseUserVariableValues

@mtojekmtojek requested a review fromjohnstcnJanuary 12, 2024 12:37
@mtojekmtojek marked this pull request as ready for reviewJanuary 12, 2024 12:37
Comment on lines +112 to +115
varsFiles,err=DiscoverVarsFiles(uploadFlags.directory)
iferr!=nil {
returnerr
}
Copy link
Member

Choose a reason for hiding this comment

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

I could imagine a case where someone had tfvars files lying around unused before, worked around the issue, and left them there. Now we're going to auto-discover them. I'm not sure what this will break.
Should at the very least add an info message about the auto-discovered vars files?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ok, I changed the code to print a message alerting about the presence of tfvars 👍

stringData[attribute.Name]=ctyValue.AsString()
}elseifctyType.Equals(cty.Number) {
stringData[attribute.Name]=ctyValue.AsBigFloat().String()
}elseifctyType.IsTupleType() {
Copy link
Member

Choose a reason for hiding this comment

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

I immediately saw this, thought 🤔 "y no switch", and then saw how annoying this is.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes, unfortunately the API isn't too friendly :)

Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

LGTM, some comments.

@mtojekmtojek merged commitcb77f04 intomainJan 12, 2024
@mtojekmtojek deleted the 8501-parse-tfvars-3 branchJanuary 12, 2024 14:08
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 12, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@mtojekmtojek

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

bug: cli/api: terraform.tfvars and *.auto.tfvars are silently ignored

2 participants

@mtojek@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp