diff --git a/terraform/graph.go b/terraform/graph.go index 1ac8dac8b..11cec4974 100644 --- a/terraform/graph.go +++ b/terraform/graph.go @@ -52,9 +52,9 @@ func (g *Graph) walk(walker GraphWalker) tfdiags.Diagnostics { // vertexCtx is the context that we use when evaluating. This // is normally the context of our graph but can be overridden - // with a GraphNodeSubPath impl. + // with a GraphNodeModuleInstance impl. vertexCtx := ctx - if pn, ok := v.(GraphNodeSubPath); ok && len(pn.Path()) > 0 { + if pn, ok := v.(GraphNodeModuleInstance); ok && len(pn.Path()) > 0 { vertexCtx = walker.EnterPath(pn.Path()) defer walker.ExitPath(pn.Path()) } diff --git a/terraform/graph_interface_subgraph.go b/terraform/graph_interface_subgraph.go index b61bac5a1..9ff6e763c 100644 --- a/terraform/graph_interface_subgraph.go +++ b/terraform/graph_interface_subgraph.go @@ -4,9 +4,9 @@ import ( "github.com/hashicorp/terraform/addrs" ) -// GraphNodeSubPath says that a node is part of a graph with a +// GraphNodeModuleInstance says that a node is part of a graph with a // different path, and the context should be adjusted accordingly. -type GraphNodeSubPath interface { +type GraphNodeModuleInstance interface { Path() addrs.ModuleInstance } diff --git a/terraform/node_data_refresh.go b/terraform/node_data_refresh.go index 87795a97f..dd0b43352 100644 --- a/terraform/node_data_refresh.go +++ b/terraform/node_data_refresh.go @@ -15,7 +15,7 @@ type NodeRefreshableDataResource struct { } var ( - _ GraphNodeSubPath = (*NodeRefreshableDataResource)(nil) + _ GraphNodeModuleInstance = (*NodeRefreshableDataResource)(nil) _ GraphNodeDynamicExpandable = (*NodeRefreshableDataResource)(nil) _ GraphNodeReferenceable = (*NodeRefreshableDataResource)(nil) _ GraphNodeReferencer = (*NodeRefreshableDataResource)(nil) diff --git a/terraform/node_local.go b/terraform/node_local.go index 06da3381f..9861f0a15 100644 --- a/terraform/node_local.go +++ b/terraform/node_local.go @@ -17,19 +17,19 @@ type NodeLocal struct { } var ( - _ GraphNodeSubPath = (*NodeLocal)(nil) - _ RemovableIfNotTargeted = (*NodeLocal)(nil) - _ GraphNodeReferenceable = (*NodeLocal)(nil) - _ GraphNodeReferencer = (*NodeLocal)(nil) - _ GraphNodeEvalable = (*NodeLocal)(nil) - _ dag.GraphNodeDotter = (*NodeLocal)(nil) + _ GraphNodeModuleInstance = (*NodeLocal)(nil) + _ RemovableIfNotTargeted = (*NodeLocal)(nil) + _ GraphNodeReferenceable = (*NodeLocal)(nil) + _ GraphNodeReferencer = (*NodeLocal)(nil) + _ GraphNodeEvalable = (*NodeLocal)(nil) + _ dag.GraphNodeDotter = (*NodeLocal)(nil) ) func (n *NodeLocal) Name() string { return n.Addr.String() } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeLocal) Path() addrs.ModuleInstance { return n.Addr.Module } diff --git a/terraform/node_module_expand.go b/terraform/node_module_expand.go index a519bd543..4051701b9 100644 --- a/terraform/node_module_expand.go +++ b/terraform/node_module_expand.go @@ -21,17 +21,17 @@ type nodeExpandModule struct { } var ( - _ GraphNodeSubPath = (*nodeExpandModule)(nil) - _ RemovableIfNotTargeted = (*nodeExpandModule)(nil) - _ GraphNodeEvalable = (*nodeExpandModule)(nil) - _ GraphNodeReferencer = (*nodeExpandModule)(nil) + _ GraphNodeModuleInstance = (*nodeExpandModule)(nil) + _ RemovableIfNotTargeted = (*nodeExpandModule)(nil) + _ GraphNodeEvalable = (*nodeExpandModule)(nil) + _ GraphNodeReferencer = (*nodeExpandModule)(nil) ) func (n *nodeExpandModule) Name() string { return n.CallerAddr.Child(n.Call.Name, addrs.NoKey).String() } -// GraphNodeSubPath implementation +// GraphNodeModuleInstance implementation func (n *nodeExpandModule) Path() addrs.ModuleInstance { // This node represents the module call within a module, // so return the CallerAddr as the path as the module diff --git a/terraform/node_module_removed.go b/terraform/node_module_removed.go index d281a2c61..e47281490 100644 --- a/terraform/node_module_removed.go +++ b/terraform/node_module_removed.go @@ -13,7 +13,7 @@ type NodeModuleRemoved struct { } var ( - _ GraphNodeSubPath = (*NodeModuleRemoved)(nil) + _ GraphNodeModuleInstance = (*NodeModuleRemoved)(nil) _ RemovableIfNotTargeted = (*NodeModuleRemoved)(nil) _ GraphNodeEvalable = (*NodeModuleRemoved)(nil) _ GraphNodeReferencer = (*NodeModuleRemoved)(nil) @@ -24,7 +24,7 @@ func (n *NodeModuleRemoved) Name() string { return fmt.Sprintf("%s (removed)", n.Addr.String()) } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeModuleRemoved) Path() addrs.ModuleInstance { return n.Addr } diff --git a/terraform/node_module_variable.go b/terraform/node_module_variable.go index 87074e913..20d6d6df7 100644 --- a/terraform/node_module_variable.go +++ b/terraform/node_module_variable.go @@ -25,7 +25,7 @@ var ( _ GraphNodeReferenceOutside = (*NodePlannableModuleVariable)(nil) _ GraphNodeReferenceable = (*NodePlannableModuleVariable)(nil) _ GraphNodeReferencer = (*NodePlannableModuleVariable)(nil) - _ GraphNodeSubPath = (*NodePlannableModuleVariable)(nil) + _ GraphNodeModuleInstance = (*NodePlannableModuleVariable)(nil) _ RemovableIfNotTargeted = (*NodePlannableModuleVariable)(nil) ) @@ -47,7 +47,7 @@ func (n *NodePlannableModuleVariable) Name() string { return fmt.Sprintf("%s.%s", n.Module, n.Addr.String()) } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodePlannableModuleVariable) Path() addrs.ModuleInstance { // Return an UnkeyedInstanceShim as our placeholder, // given that modules will be unexpanded at this point in the walk @@ -122,7 +122,7 @@ type NodeApplyableModuleVariable struct { // Ensure that we are implementing all of the interfaces we think we are // implementing. var ( - _ GraphNodeSubPath = (*NodeApplyableModuleVariable)(nil) + _ GraphNodeModuleInstance = (*NodeApplyableModuleVariable)(nil) _ RemovableIfNotTargeted = (*NodeApplyableModuleVariable)(nil) _ GraphNodeReferenceOutside = (*NodeApplyableModuleVariable)(nil) _ GraphNodeReferenceable = (*NodeApplyableModuleVariable)(nil) @@ -135,7 +135,7 @@ func (n *NodeApplyableModuleVariable) Name() string { return n.Addr.String() } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeApplyableModuleVariable) Path() addrs.ModuleInstance { // We execute in the parent scope (above our own module) because // expressions in our value are resolved in that context. diff --git a/terraform/node_output.go b/terraform/node_output.go index 88e62a984..e391b1ead 100644 --- a/terraform/node_output.go +++ b/terraform/node_output.go @@ -18,9 +18,9 @@ type NodePlannableOutput struct { } var ( - _ GraphNodeSubPath = (*NodePlannableOutput)(nil) - _ RemovableIfNotTargeted = (*NodePlannableOutput)(nil) - _ GraphNodeReferenceable = (*NodePlannableOutput)(nil) + _ GraphNodeModuleInstance = (*NodePlannableOutput)(nil) + _ RemovableIfNotTargeted = (*NodePlannableOutput)(nil) + _ GraphNodeReferenceable = (*NodePlannableOutput)(nil) //_ GraphNodeEvalable = (*NodePlannableOutput)(nil) _ GraphNodeReferencer = (*NodePlannableOutput)(nil) _ GraphNodeDynamicExpandable = (*NodePlannableOutput)(nil) @@ -44,7 +44,7 @@ func (n *NodePlannableOutput) Name() string { return n.Addr.Absolute(n.Module.UnkeyedInstanceShim()).String() } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodePlannableOutput) Path() addrs.ModuleInstance { // Return an UnkeyedInstanceShim as our placeholder, // given that modules will be unexpanded at this point in the walk @@ -114,7 +114,7 @@ type NodeApplyableOutput struct { } var ( - _ GraphNodeSubPath = (*NodeApplyableOutput)(nil) + _ GraphNodeModuleInstance = (*NodeApplyableOutput)(nil) _ RemovableIfNotTargeted = (*NodeApplyableOutput)(nil) _ GraphNodeTargetDownstream = (*NodeApplyableOutput)(nil) _ GraphNodeReferenceable = (*NodeApplyableOutput)(nil) @@ -128,7 +128,7 @@ func (n *NodeApplyableOutput) Name() string { return n.Addr.String() } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeApplyableOutput) Path() addrs.ModuleInstance { return n.Addr.Module } @@ -247,7 +247,7 @@ type NodeDestroyableOutput struct { } var ( - _ GraphNodeSubPath = (*NodeDestroyableOutput)(nil) + _ GraphNodeModuleInstance = (*NodeDestroyableOutput)(nil) _ RemovableIfNotTargeted = (*NodeDestroyableOutput)(nil) _ GraphNodeTargetDownstream = (*NodeDestroyableOutput)(nil) _ GraphNodeReferencer = (*NodeDestroyableOutput)(nil) @@ -259,7 +259,7 @@ func (n *NodeDestroyableOutput) Name() string { return fmt.Sprintf("%s (destroy)", n.Addr.String()) } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeDestroyableOutput) Path() addrs.ModuleInstance { return n.Module.UnkeyedInstanceShim() } diff --git a/terraform/node_output_orphan.go b/terraform/node_output_orphan.go index d52dd8fa2..060f27ea7 100644 --- a/terraform/node_output_orphan.go +++ b/terraform/node_output_orphan.go @@ -12,7 +12,7 @@ type NodeOutputOrphan struct { } var ( - _ GraphNodeSubPath = (*NodeOutputOrphan)(nil) + _ GraphNodeModuleInstance = (*NodeOutputOrphan)(nil) _ GraphNodeReferenceable = (*NodeOutputOrphan)(nil) _ GraphNodeReferenceOutside = (*NodeOutputOrphan)(nil) _ GraphNodeEvalable = (*NodeOutputOrphan)(nil) @@ -32,7 +32,7 @@ func (n *NodeOutputOrphan) ReferenceableAddrs() []addrs.Referenceable { return referenceableAddrsForOutput(n.Addr) } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeOutputOrphan) Path() addrs.ModuleInstance { return n.Addr.Module } diff --git a/terraform/node_provider_abstract.go b/terraform/node_provider_abstract.go index c05751bc3..5c0d953f3 100644 --- a/terraform/node_provider_abstract.go +++ b/terraform/node_provider_abstract.go @@ -26,7 +26,7 @@ type NodeAbstractProvider struct { } var ( - _ GraphNodeSubPath = (*NodeAbstractProvider)(nil) + _ GraphNodeModuleInstance = (*NodeAbstractProvider)(nil) _ RemovableIfNotTargeted = (*NodeAbstractProvider)(nil) _ GraphNodeReferencer = (*NodeAbstractProvider)(nil) _ GraphNodeProvider = (*NodeAbstractProvider)(nil) @@ -39,7 +39,7 @@ func (n *NodeAbstractProvider) Name() string { return n.Addr.String() } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeAbstractProvider) Path() addrs.ModuleInstance { return n.Addr.Module } diff --git a/terraform/node_provider_disabled.go b/terraform/node_provider_disabled.go index 30d8813a4..fc66f2e60 100644 --- a/terraform/node_provider_disabled.go +++ b/terraform/node_provider_disabled.go @@ -14,7 +14,7 @@ type NodeDisabledProvider struct { } var ( - _ GraphNodeSubPath = (*NodeDisabledProvider)(nil) + _ GraphNodeModuleInstance = (*NodeDisabledProvider)(nil) _ RemovableIfNotTargeted = (*NodeDisabledProvider)(nil) _ GraphNodeReferencer = (*NodeDisabledProvider)(nil) _ GraphNodeProvider = (*NodeDisabledProvider)(nil) diff --git a/terraform/node_provisioner.go b/terraform/node_provisioner.go index cf51cf06c..1160498ae 100644 --- a/terraform/node_provisioner.go +++ b/terraform/node_provisioner.go @@ -14,9 +14,9 @@ type NodeProvisioner struct { } var ( - _ GraphNodeSubPath = (*NodeProvisioner)(nil) - _ GraphNodeProvisioner = (*NodeProvisioner)(nil) - _ GraphNodeEvalable = (*NodeProvisioner)(nil) + _ GraphNodeModuleInstance = (*NodeProvisioner)(nil) + _ GraphNodeProvisioner = (*NodeProvisioner)(nil) + _ GraphNodeEvalable = (*NodeProvisioner)(nil) ) func (n *NodeProvisioner) Name() string { @@ -28,7 +28,7 @@ func (n *NodeProvisioner) Name() string { return result } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeProvisioner) Path() addrs.ModuleInstance { return n.PathValue } diff --git a/terraform/node_resource_abstract.go b/terraform/node_resource_abstract.go index 8ad80f7fb..c558ac368 100644 --- a/terraform/node_resource_abstract.go +++ b/terraform/node_resource_abstract.go @@ -69,7 +69,7 @@ type NodeAbstractResource struct { } var ( - _ GraphNodeSubPath = (*NodeAbstractResource)(nil) + _ GraphNodeModuleInstance = (*NodeAbstractResource)(nil) _ GraphNodeReferenceable = (*NodeAbstractResource)(nil) _ GraphNodeReferencer = (*NodeAbstractResource)(nil) _ GraphNodeProviderConsumer = (*NodeAbstractResource)(nil) @@ -108,7 +108,7 @@ type NodeAbstractResourceInstance struct { } var ( - _ GraphNodeSubPath = (*NodeAbstractResourceInstance)(nil) + _ GraphNodeModuleInstance = (*NodeAbstractResourceInstance)(nil) _ GraphNodeReferenceable = (*NodeAbstractResourceInstance)(nil) _ GraphNodeReferencer = (*NodeAbstractResourceInstance)(nil) _ GraphNodeProviderConsumer = (*NodeAbstractResourceInstance)(nil) @@ -148,7 +148,7 @@ func (n *NodeAbstractResourceInstance) Name() string { return n.ResourceInstanceAddr().String() } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeAbstractResource) Path() addrs.ModuleInstance { return n.Addr.Module } diff --git a/terraform/node_resource_plan.go b/terraform/node_resource_plan.go index 69187d5f3..bd567e052 100644 --- a/terraform/node_resource_plan.go +++ b/terraform/node_resource_plan.go @@ -19,7 +19,7 @@ type NodePlannableResource struct { } var ( - _ GraphNodeSubPath = (*NodePlannableResource)(nil) + _ GraphNodeModuleInstance = (*NodePlannableResource)(nil) _ GraphNodeDestroyerCBD = (*NodePlannableResource)(nil) _ GraphNodeDynamicExpandable = (*NodePlannableResource)(nil) _ GraphNodeReferenceable = (*NodePlannableResource)(nil) diff --git a/terraform/node_resource_plan_destroy.go b/terraform/node_resource_plan_destroy.go index d0f63a561..deb6b4f7b 100644 --- a/terraform/node_resource_plan_destroy.go +++ b/terraform/node_resource_plan_destroy.go @@ -17,7 +17,7 @@ type NodePlanDestroyableResourceInstance struct { } var ( - _ GraphNodeSubPath = (*NodePlanDestroyableResourceInstance)(nil) + _ GraphNodeModuleInstance = (*NodePlanDestroyableResourceInstance)(nil) _ GraphNodeReferenceable = (*NodePlanDestroyableResourceInstance)(nil) _ GraphNodeReferencer = (*NodePlanDestroyableResourceInstance)(nil) _ GraphNodeDestroyer = (*NodePlanDestroyableResourceInstance)(nil) diff --git a/terraform/node_resource_plan_instance.go b/terraform/node_resource_plan_instance.go index e9a3c60f5..27465981a 100644 --- a/terraform/node_resource_plan_instance.go +++ b/terraform/node_resource_plan_instance.go @@ -20,7 +20,7 @@ type NodePlannableResourceInstance struct { } var ( - _ GraphNodeSubPath = (*NodePlannableResourceInstance)(nil) + _ GraphNodeModuleInstance = (*NodePlannableResourceInstance)(nil) _ GraphNodeReferenceable = (*NodePlannableResourceInstance)(nil) _ GraphNodeReferencer = (*NodePlannableResourceInstance)(nil) _ GraphNodeResource = (*NodePlannableResourceInstance)(nil) diff --git a/terraform/node_resource_plan_orphan.go b/terraform/node_resource_plan_orphan.go index 841669491..61f8e621f 100644 --- a/terraform/node_resource_plan_orphan.go +++ b/terraform/node_resource_plan_orphan.go @@ -13,7 +13,7 @@ type NodePlannableResourceInstanceOrphan struct { } var ( - _ GraphNodeSubPath = (*NodePlannableResourceInstanceOrphan)(nil) + _ GraphNodeModuleInstance = (*NodePlannableResourceInstanceOrphan)(nil) _ GraphNodeReferenceable = (*NodePlannableResourceInstanceOrphan)(nil) _ GraphNodeReferencer = (*NodePlannableResourceInstanceOrphan)(nil) _ GraphNodeResource = (*NodePlannableResourceInstanceOrphan)(nil) diff --git a/terraform/node_resource_refresh.go b/terraform/node_resource_refresh.go index 37ac90592..53fdf2cba 100644 --- a/terraform/node_resource_refresh.go +++ b/terraform/node_resource_refresh.go @@ -25,7 +25,7 @@ type NodeRefreshableManagedResource struct { } var ( - _ GraphNodeSubPath = (*NodeRefreshableManagedResource)(nil) + _ GraphNodeModuleInstance = (*NodeRefreshableManagedResource)(nil) _ GraphNodeDynamicExpandable = (*NodeRefreshableManagedResource)(nil) _ GraphNodeReferenceable = (*NodeRefreshableManagedResource)(nil) _ GraphNodeReferencer = (*NodeRefreshableManagedResource)(nil) @@ -142,7 +142,7 @@ type NodeRefreshableManagedResourceInstance struct { } var ( - _ GraphNodeSubPath = (*NodeRefreshableManagedResourceInstance)(nil) + _ GraphNodeModuleInstance = (*NodeRefreshableManagedResourceInstance)(nil) _ GraphNodeReferenceable = (*NodeRefreshableManagedResourceInstance)(nil) _ GraphNodeReferencer = (*NodeRefreshableManagedResourceInstance)(nil) _ GraphNodeDestroyer = (*NodeRefreshableManagedResourceInstance)(nil) diff --git a/terraform/node_resource_validate.go b/terraform/node_resource_validate.go index dec63d8df..3703d81ba 100644 --- a/terraform/node_resource_validate.go +++ b/terraform/node_resource_validate.go @@ -15,7 +15,7 @@ type NodeValidatableResource struct { } var ( - _ GraphNodeSubPath = (*NodeValidatableResource)(nil) + _ GraphNodeModuleInstance = (*NodeValidatableResource)(nil) _ GraphNodeEvalable = (*NodeValidatableResource)(nil) _ GraphNodeReferenceable = (*NodeValidatableResource)(nil) _ GraphNodeReferencer = (*NodeValidatableResource)(nil) diff --git a/terraform/node_root_variable.go b/terraform/node_root_variable.go index 5c17619b7..1144f3f1f 100644 --- a/terraform/node_root_variable.go +++ b/terraform/node_root_variable.go @@ -13,16 +13,16 @@ type NodeRootVariable struct { } var ( - _ GraphNodeSubPath = (*NodeRootVariable)(nil) - _ GraphNodeReferenceable = (*NodeRootVariable)(nil) - _ dag.GraphNodeDotter = (*NodeApplyableModuleVariable)(nil) + _ GraphNodeModuleInstance = (*NodeRootVariable)(nil) + _ GraphNodeReferenceable = (*NodeRootVariable)(nil) + _ dag.GraphNodeDotter = (*NodeApplyableModuleVariable)(nil) ) func (n *NodeRootVariable) Name() string { return n.Addr.String() } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *NodeRootVariable) Path() addrs.ModuleInstance { return addrs.RootModuleInstance } diff --git a/terraform/transform_attach_config_provider.go b/terraform/transform_attach_config_provider.go index 897a7e791..e1cf66362 100644 --- a/terraform/transform_attach_config_provider.go +++ b/terraform/transform_attach_config_provider.go @@ -9,7 +9,7 @@ import ( // that want provider configurations attached. type GraphNodeAttachProvider interface { // Must be implemented to determine the path for the configuration - GraphNodeSubPath + GraphNodeModuleInstance // ProviderName with no module prefix. Example: "aws". ProviderAddr() addrs.AbsProviderConfig diff --git a/terraform/transform_import_state.go b/terraform/transform_import_state.go index 7fe5f12ad..22c56be4d 100644 --- a/terraform/transform_import_state.go +++ b/terraform/transform_import_state.go @@ -48,7 +48,7 @@ type graphNodeImportState struct { } var ( - _ GraphNodeSubPath = (*graphNodeImportState)(nil) + _ GraphNodeModuleInstance = (*graphNodeImportState)(nil) _ GraphNodeEvalable = (*graphNodeImportState)(nil) _ GraphNodeProviderConsumer = (*graphNodeImportState)(nil) _ GraphNodeDynamicExpandable = (*graphNodeImportState)(nil) @@ -83,7 +83,7 @@ func (n *graphNodeImportState) SetProvider(addr addrs.AbsProviderConfig) { n.ResolvedProvider = addr } -// GraphNodeSubPath +// GraphNodeModuleInstance func (n *graphNodeImportState) Path() addrs.ModuleInstance { return n.Addr.Module } @@ -199,8 +199,8 @@ type graphNodeImportStateSub struct { } var ( - _ GraphNodeSubPath = (*graphNodeImportStateSub)(nil) - _ GraphNodeEvalable = (*graphNodeImportStateSub)(nil) + _ GraphNodeModuleInstance = (*graphNodeImportStateSub)(nil) + _ GraphNodeEvalable = (*graphNodeImportStateSub)(nil) ) func (n *graphNodeImportStateSub) Name() string { diff --git a/terraform/transform_module_expansion.go b/terraform/transform_module_expansion.go index e8d2c4a32..b2cdc6296 100644 --- a/terraform/transform_module_expansion.go +++ b/terraform/transform_module_expansion.go @@ -65,7 +65,7 @@ func (t *ModuleExpansionTransformer) transform(g *Graph, c *configs.Config, pare // work to properly support "count" and "for_each" for modules. Nodes // in the plan graph actually belong to modules, not to module instances. for _, childV := range g.Vertices() { - pather, ok := childV.(GraphNodeSubPath) + pather, ok := childV.(GraphNodeModuleInstance) if !ok { continue } diff --git a/terraform/transform_provider.go b/terraform/transform_provider.go index 18f628995..82e72b462 100644 --- a/terraform/transform_provider.go +++ b/terraform/transform_provider.go @@ -44,7 +44,7 @@ func TransformProviders(providers []string, concrete ConcreteProviderNodeFunc, c // // Name returns the full name of the provider in the config. type GraphNodeProvider interface { - GraphNodeSubPath + GraphNodeModuleInstance ProviderAddr() addrs.AbsProviderConfig Name() string } @@ -53,7 +53,7 @@ type GraphNodeProvider interface { // provider must implement. The CloseProviderName returned is the name of // the provider they satisfy. type GraphNodeCloseProvider interface { - GraphNodeSubPath + GraphNodeModuleInstance CloseProviderAddr() addrs.AbsProviderConfig } @@ -186,7 +186,7 @@ func (t *ProviderTransformer) Transform(g *Graph) error { p := req.Addr target := m[key] - _, ok := v.(GraphNodeSubPath) + _, ok := v.(GraphNodeModuleInstance) if !ok && target == nil { // No target and no path to traverse up from diags = diags.Append(fmt.Errorf("%s: provider %s couldn't be found", dag.VertexName(v), p)) @@ -412,7 +412,7 @@ func (t *MissingProviderTransformer) Transform(g *Graph) error { // ParentProviderTransformer connects provider nodes to their parents. // // This works by finding nodes that are both GraphNodeProviders and -// GraphNodeSubPath. It then connects the providers to their parent +// GraphNodeModuleInstance. It then connects the providers to their parent // path. The parent provider is always at the root level. type ParentProviderTransformer struct{} @@ -511,7 +511,7 @@ func (n *graphNodeCloseProvider) Name() string { return n.Addr.String() + " (close)" } -// GraphNodeSubPath impl. +// GraphNodeModuleInstance impl. func (n *graphNodeCloseProvider) Path() addrs.ModuleInstance { return n.Addr.Module } diff --git a/terraform/transform_reference.go b/terraform/transform_reference.go index aa82d2342..13f1046af 100644 --- a/terraform/transform_reference.go +++ b/terraform/transform_reference.go @@ -293,7 +293,7 @@ func (m *ReferenceMap) mapKey(path addrs.Module, addr addrs.Referenceable) strin // referenced. This is the path that its results from ReferenceableAddrs // are considered to be relative to. // -// Only GraphNodeSubPath implementations can be referenced, so this method will +// Only GraphNodeModuleInstance implementations can be referenced, so this method will // panic if the given vertex does not implement that interface. func vertexReferenceablePath(v dag.Vertex) addrs.Module { sp, ok := v.(GraphNodeModulePath) @@ -316,7 +316,7 @@ func vertexReferenceablePath(v dag.Vertex) addrs.Module { // vertexReferencePath returns the path in which references _from_ the given // vertex must be interpreted. // -// Only GraphNodeSubPath implementations can have references, so this method +// Only GraphNodeModuleInstance implementations can have references, so this method // will panic if the given vertex does not implement that interface. func vertexReferencePath(v dag.Vertex) addrs.Module { sp, ok := v.(GraphNodeModulePath) @@ -344,7 +344,7 @@ func vertexReferencePath(v dag.Vertex) addrs.Module { // The result is an opaque string that includes both the address of the given // object and the address of the module instance that object belongs to. // -// Only GraphNodeSubPath implementations can be referrers, so this method will +// Only GraphNodeModuleInstance implementations can be referrers, so this method will // panic if the given vertex does not implement that interface. func (m *ReferenceMap) referenceMapKey(referrer dag.Vertex, addr addrs.Referenceable) string { path := vertexReferencePath(referrer) @@ -359,7 +359,7 @@ func NewReferenceMap(vs []dag.Vertex) *ReferenceMap { // Build the lookup table vertices := make(map[string][]dag.Vertex) for _, v := range vs { - _, ok := v.(GraphNodeSubPath) + _, ok := v.(GraphNodeModuleInstance) if !ok { // Only nodes with paths can participate in a reference map. continue