load Meta.PluginOverrides in dicovery

Make sure the override paths from the legacy rc file are loaded for
discovery.
This commit is contained in:
James Bardin 2017-08-09 11:14:33 -04:00
parent fa20d43d80
commit 54998933f5
1 changed files with 12 additions and 0 deletions

View File

@ -172,6 +172,12 @@ func (m *Meta) pluginDirs(includeAutoInstalled bool) []string {
// the defined search paths. // the defined search paths.
func (m *Meta) providerPluginSet() discovery.PluginMetaSet { func (m *Meta) providerPluginSet() discovery.PluginMetaSet {
plugins := discovery.FindPlugins("provider", m.pluginDirs(true)) plugins := discovery.FindPlugins("provider", m.pluginDirs(true))
// Add providers defined in the legacy .terraformrc,
if m.PluginOverrides != nil {
plugins = plugins.OverridePaths(m.PluginOverrides.Providers)
}
plugins, _ = plugins.ValidateVersions() plugins, _ = plugins.ValidateVersions()
for p := range plugins { for p := range plugins {
@ -198,6 +204,12 @@ func (m *Meta) providerPluginAutoInstalledSet() discovery.PluginMetaSet {
// in all locations *except* the auto-install directory. // in all locations *except* the auto-install directory.
func (m *Meta) providerPluginManuallyInstalledSet() discovery.PluginMetaSet { func (m *Meta) providerPluginManuallyInstalledSet() discovery.PluginMetaSet {
plugins := discovery.FindPlugins("provider", m.pluginDirs(false)) plugins := discovery.FindPlugins("provider", m.pluginDirs(false))
// Add providers defined in the legacy .terraformrc,
if m.PluginOverrides != nil {
plugins = plugins.OverridePaths(m.PluginOverrides.Providers)
}
plugins, _ = plugins.ValidateVersions() plugins, _ = plugins.ValidateVersions()
for p := range plugins { for p := range plugins {