Continue pushing the Path calls out of the Resource and Provider types#24346
Merged
Continue pushing the Path calls out of the Resource and Provider types#24346
Conversation
Remove the requirement for most *Resource types to be a GraphNodeModuleInstance, ensuring that they never call ctx.Path while being evaluated. This gets rid of most of the direct need for the Path method currently implemented by NodeResourceAbstract, leaving the provider and schema related calls for a subsequent PR.
Change ModuleInstance to Module in AbsProviderConfig, because providers need to be handled before module expansion, and should not be used defined inside an expanded module at all. Renaming of the addrs type can happen later, when there's less work in-flight around provider configuration.
mildwonkey
reviewed
Mar 11, 2020
| } | ||
|
|
||
| return fmt.Sprintf("%s.%s[%q]", pc.Module.String(), "provider", pc.Provider.String()) | ||
| return strings.Join(parts, ".") |
Contributor
There was a problem hiding this comment.
what a lovely refactor, thank you! That's MUCH nicer to read ❤️
mildwonkey
approved these changes
Mar 11, 2020
Contributor
mildwonkey
left a comment
There was a problem hiding this comment.
This looks great, thank you for taking care of it! I'll approve now so you can merge as soon as your other PR gets merged.
Change all ModuleInstances in provider types to plain Modules
78024d7 to
98cfb51
Compare
noahmercado
pushed a commit
to noahmercado/terraform
that referenced
this pull request
Apr 8, 2020
…nsion-another-part Continue pushing the Path calls out of the Resource and Provider types
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This starts with some more removal of the
Pathmethod from*Resourcetypes, so we can work with them in an unexpanded context.The majority of this PR is the conversion of the
addrs.AbsProviderConfigto use aModulerather than aModuleInstance. TheAbsprefix inAbsProviderConfigis retained for now to reduce the size of the changes, and we can do a wholesale rename later when there is less work in-flight.