-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
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.
} | ||
|
||
return fmt.Sprintf("%s.%s[%q]", pc.Module.String(), "provider", pc.Provider.String()) | ||
return strings.Join(parts, ".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what a lovely refactor, thank you! That's MUCH nicer to read ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
…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 starts with some more removal of the
Path
method from*Resource
types, so we can work with them in an unexpanded context.The majority of this PR is the conversion of the
addrs.AbsProviderConfig
to use aModule
rather than aModuleInstance
. TheAbs
prefix inAbsProviderConfig
is 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.