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

more module expansion foundation #24389

Merged
merged 6 commits into from
Mar 17, 2020
Merged

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Mar 16, 2020

  • Change states.Resource to use an addrs.AbsResource address:
    As we pass around a resource state, we need to use it in situations where the expanded module context is not available. It helps us to have the original module from which the resource was loaded to fill in the missing expanded module path. This doesn't change the state itself in any way, it simply saves the full module path into the Resource structure while loading the state.

  • Change GraphNodeResource to GraphNodeConfigResource to better indicate use usage of that interface.

We need to fixup count by config path, not by absolute path, so update
MaybeFixUpResourceInstanceAddressForCount to work with
addrs.ConfigResource.
The ModuleInstance is known while building the state resource, but it's
not recorded. Since a resource may be retrieved via a ConfigResource
address, we need to know from which module instance it was loaded.
Make the interface name reflect the new return type of the method.
Remove the confusingly named and unused ResourceAddress method from the
resource nodes as well.
@jbardin jbardin requested a review from a team March 16, 2020 21:28
@ghost ghost added the sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK label Mar 16, 2020
@codecov
Copy link

codecov bot commented Mar 16, 2020

Codecov Report

Merging #24389 into master will decrease coverage by 0.02%.
The diff coverage is 64.22%.

Impacted Files Coverage Δ
states/resource.go 44.15% <ø> (ø)
states/state.go 14.56% <0.00%> (-2.11%) ⬇️
states/state_string.go 0.00% <0.00%> (ø)
states/sync.go 0.00% <0.00%> (ø)
terraform/node_data_refresh.go 91.83% <ø> (ø)
terraform/node_resource_apply.go 70.00% <ø> (ø)
terraform/node_resource_destroy_deposed.go 93.82% <ø> (ø)
terraform/node_resource_plan.go 92.75% <ø> (ø)
terraform/node_resource_plan_destroy.go 95.12% <ø> (ø)
terraform/node_resource_plan_instance.go 97.95% <ø> (ø)
... and 31 more

Copy link
Contributor

@mildwonkey mildwonkey left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me!

@jbardin jbardin merged commit 8116b9c into master Mar 17, 2020
@jbardin jbardin deleted the jbardin/module-expansion-getting-there branch March 17, 2020 13:43
@ghost
Copy link

ghost commented Apr 17, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants