-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
[WIP] core: Ensure that DataSourcesMap is handled during apply w/destroy #6913
[WIP] core: Ensure that DataSourcesMap is handled during apply w/destroy #6913
Conversation
During accpeptance tests of some of the first data sources (see hashicorp#6881 and hashicorp#6911), "unknown resource type" errors were coming up. It looks like DataSourcesMap was not being taken into account in *schema.Provider.Apply(), causing this error. Also, added a skip in *schema.Resource.Apply() if *schema.Resource.Destroy() is not defined, as data sources do not define this, fixing the first error resulted in a nil pointer dereference.
4695251
to
2da4501
Compare
@vancluever do you think this is the same issue @jen20 was trying to address in #6907? We noticed during some debugging that we're generating "destroy" and "destroy tainted" nodes for data resources, which isn't supposed to happen and isn't handled properly in core... the "destroy" nodes always do the managed resource behavior, regardless of resource type. He ultimately decided that this wasn't the right fix and we didn't discuss why, but just want to make sure we're not trying to solve the same problem in a multitude of different ways... |
@apparentlymart this is a little different - the intention isn't to do anything with the graph, but one thing I did notice is that If anything I'd say the latter part is more around fixing the destroy walk issue, where we just ignore a missing I did notice that @jen20 did say that the destroy stuff was needed in some respect, I figured that you guys might have talked about it though :) Some additional thoughts: I'm not too sure if ignoring |
The intention here is that we never enter If I'm understanding this patch correctly then it makes it illegal to have both a resource and a data source both called I suspect that whatever patch replaces #6907 will make this patch moot, since it will prevent us from reaching any of the branches you've created here... but we can wait until @jen20 has found a new path and confirm if this remains true. |
Yeah, this is something I was wondering about. (I was thinking about renaming the data source in #6911 to Maybe my efforts are better focused on trying to figure out why the root of the issue exists then versus trying to work around it... seeing as I am still trying to figure out how to test |
I think I've found the root cause, closing this now and will be putting in another PR in a sec. |
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. |
Fixes #6881, which came up for me in #6911 as well.
WIP because I'm still trying to find a good way to test the
*schema.Provider
part.