Skip to content

refactor(cli): load template variables #11234

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

Merged
merged 2 commits into from
Dec 15, 2023
Merged

refactor(cli): load template variables #11234

merged 2 commits into from
Dec 15, 2023

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Dec 15, 2023

Related: #8501

I need to refactor existing CLI logic to load template variables and prepare it for another source, local tfvars files.

@mtojek mtojek self-assigned this Dec 15, 2023
@mtojek mtojek changed the title refactor(cli): loading template variables refactor(cli): load template variables Dec 15, 2023
@mtojek mtojek marked this pull request as ready for review December 15, 2023 13:41
@mtojek mtojek requested a review from johnstcn December 15, 2023 13:41
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

LGTM 👍

return nil, err
}

return combineVariableValues(fromFile, fromCommandLine), nil
Copy link
Member

Choose a reason for hiding this comment

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

This raises an interesting question - what should the order of precedence be between values from files and values specified directly by CLI?
My hunch is that CLI variables should override those specified in files, and looking at combineVariableValues below that seems to be what would happen here.

Copy link
Member Author

Choose a reason for hiding this comment

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

My hunch is that CLI variables should override those specified in files, and looking at combineVariableValues below that seems to be what would happen here.

Yeah, that is my idea too. I described the order of precedence here.

@mtojek mtojek merged commit 58c2ce1 into main Dec 15, 2023
@mtojek mtojek deleted the 8501-parse-tfvars-2 branch December 15, 2023 13:55
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants