From efafadbe5edbfd8faa250aa1eaed46fbb2d52ee2 Mon Sep 17 00:00:00 2001 From: Kristin Laemmert Date: Mon, 9 Dec 2019 09:47:09 -0500 Subject: [PATCH] command: rename choosePlugins to chooseProviders to clarify scope of function --- command/init.go | 4 ++-- command/plugins.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/command/init.go b/command/init.go index 0d3b9bd6c..3cc738408 100644 --- a/command/init.go +++ b/command/init.go @@ -496,7 +496,7 @@ func (c *InitCommand) getProviders(earlyConfig *earlyconfig.Config, state *state configReqs := configDeps.AllPluginRequirements() // FIXME: This is weird because ConfigTreeDependencies was written before // we switched over to using earlyConfig as the main source of dependencies. - // In future we should clean this up to be a more reasoable API. + // In future we should clean this up to be a more reasonable API. stateReqs := terraform.ConfigTreeDependencies(nil, state).AllPluginRequirements() requirements := configReqs.Merge(stateReqs) @@ -597,7 +597,7 @@ func (c *InitCommand) getProviders(earlyConfig *earlyconfig.Config, state *state available = c.providerPluginSet() // re-discover to see newly-installed plugins // internal providers were already filtered out, since we don't need to get them. - chosen := choosePlugins(available, nil, requirements) + chosen := chooseProviders(available, nil, requirements) digests := map[string][]byte{} for name, meta := range chosen { diff --git a/command/plugins.go b/command/plugins.go index 2264324e5..6a3a7f0ab 100644 --- a/command/plugins.go +++ b/command/plugins.go @@ -39,7 +39,7 @@ type multiVersionProviderResolver struct { Internal map[addrs.Provider]providers.Factory } -func choosePlugins(avail discovery.PluginMetaSet, internal map[addrs.Provider]providers.Factory, reqd discovery.PluginRequirements) map[string]discovery.PluginMeta { +func chooseProviders(avail discovery.PluginMetaSet, internal map[addrs.Provider]providers.Factory, reqd discovery.PluginRequirements) map[string]discovery.PluginMeta { candidates := avail.ConstrainVersions(reqd) ret := map[string]discovery.PluginMeta{} for name, metas := range candidates { @@ -63,7 +63,7 @@ func (r *multiVersionProviderResolver) ResolveProviders( factories := make(map[addrs.Provider]providers.Factory, len(reqd)) var errs []error - chosen := choosePlugins(r.Available, r.Internal, reqd) + chosen := chooseProviders(r.Available, r.Internal, reqd) for name, req := range reqd { if factory, isInternal := r.Internal[addrs.NewLegacyProvider(name)]; isInternal { if !req.Versions.Unconstrained() {