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

Introduce concept of merge strategy for includes #1724

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

yorinasub17
Copy link
Contributor

This adds a new attribute merge_strategy to include blocks, allowing you to specify an include block without merging the config in. This can be used in conjunction with the new expose attribute to simulate read_terragrunt_config for certain use cases. Note that due to the limitation of single include blocks, it is not a full replacement for read_terragrunt_config (yet).

This PR also refactors the merge functionality of the config into a new include.go file. This is in preparation for the next PR after this one, which will introduce deep merge strategy.

@yorinasub17 yorinasub17 requested a review from brikis98 as a code owner June 17, 2021 18:13
@yorinasub17 yorinasub17 force-pushed the yori-merge-strategy branch from 0d756e6 to f69e4da Compare June 17, 2021 18:34
@yorinasub17 yorinasub17 mentioned this pull request Jun 17, 2021
5 tasks
@yorinasub17 yorinasub17 force-pushed the yori-merge-strategy branch 3 times, most recently from f8c48d7 to 815da32 Compare June 21, 2021 14:55
@yorinasub17 yorinasub17 force-pushed the yori-merge-strategy branch from 815da32 to 5f18f90 Compare June 28, 2021 19:33
Copy link
Member

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -203,6 +204,29 @@ func (cfg *IncludeConfig) GetExpose() bool {
return *cfg.Expose
}

func (cfg *IncludeConfig) GetMergeStrategy() (MergeStrategyType, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary because you can't set the type of MergeStrategy to *MergeStrategyType in IncludeConfig? I guess the HCL parser doesn't know how to parse a string into that type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup... unfortunately.

@yorinasub17
Copy link
Contributor Author

Thanks for review! Will merge now.

@yorinasub17 yorinasub17 merged commit 0b2dc10 into master Jul 29, 2021
@yorinasub17 yorinasub17 deleted the yori-merge-strategy branch July 29, 2021 15:24
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.

2 participants