diff --git a/terraform/context.go b/terraform/context.go index e344b306d6..e5d4cc1a6f 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -178,7 +178,7 @@ func NewContext(opts *ContextOpts) (*Context, error) { var providers map[string]ResourceProviderFactory if opts.ProviderResolver != nil { var err error - deps := moduleTreeDependencies(opts.Module, state) + deps := ModuleTreeDependencies(opts.Module, state) reqd := deps.AllPluginRequirements() providers, err = resourceProviderFactories(opts.ProviderResolver, reqd) if err != nil { diff --git a/terraform/module_dependencies.go b/terraform/module_dependencies.go index 79cfcb822a..ffc6920c86 100644 --- a/terraform/module_dependencies.go +++ b/terraform/module_dependencies.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform/plugin/discovery" ) -// moduleTreeDependencies returns the dependencies of the tree of modules +// ModuleTreeDependencies returns the dependencies of the tree of modules // described by the given configuration tree and state. // // Both configuration and state are required because there can be resources @@ -16,7 +16,7 @@ import ( // This function will panic if any invalid version constraint strings are // present in the configuration. This is guaranteed not to happen for any // configuration that has passed a call to Config.Validate(). -func moduleTreeDependencies(root *module.Tree, state *State) *moduledeps.Module { +func ModuleTreeDependencies(root *module.Tree, state *State) *moduledeps.Module { // First we walk the configuration tree to build the overall structure // and capture the explicit/implicit/inherited provider dependencies. diff --git a/terraform/module_dependencies_test.go b/terraform/module_dependencies_test.go index b17c42daa2..6fced8a80d 100644 --- a/terraform/module_dependencies_test.go +++ b/terraform/module_dependencies_test.go @@ -248,7 +248,7 @@ func TestModuleTreeDependencies(t *testing.T) { root = testModule(t, test.ConfigDir) } - got := moduleTreeDependencies(root, test.State) + got := ModuleTreeDependencies(root, test.State) if !got.Equal(test.Want) { t.Errorf( "wrong dependency tree\ngot: %s\nwant: %s",