// providerInstallerCustomSource is a variant of providerInstaller that
// allows the caller to specify a different installation source than the one
// that would naturally be selected.
//
// The result of this method has the same dependencies and constraints as
// providerInstaller.
//
// The result of providerInstallerCustomSource differs from
// providerInstaller only in how it determines package installation locations
// during EnsureProviderVersions. A caller that doesn't call
// EnsureProviderVersions (anything other than "terraform init") can safely
// just use the providerInstaller method unconditionally.
providerInstallerCustomSource is a variant of providerInstaller that
allows the caller to specify a different installation source than the one
that would naturally be selected.

The result of this method has the same dependencies and constraints as
providerInstaller.

The result of providerInstallerCustomSource differs from
providerInstaller only in how it determines package installation locations
during EnsureProviderVersions. A caller that doesn't call
EnsureProviderVersions (anything other than "terraform init") can safely
just use the providerInstaller method unconditionally.
// providerInstallerCustomSource is a variant of providerInstaller that // allows the caller to specify a different installation source than the one // that would naturally be selected . // // The result of this method has the same dependencies and constraints as // providerInstaller . // // The result of providerInstallerCustomSource differs from // providerInstaller only in how it determines package installation locations // during EnsureProviderVersions . A caller that doesn ' t call // EnsureProviderVersions ( anything other than " terraform init " ) can safely // just use the providerInstaller method unconditionally .
func (m *Meta) providerInstallerCustomSource(source getproviders.Source) *providercache.Installer {
	targetDir := m.providerLocalCacheDir()
	globalCacheDir := m.providerGlobalCacheDir()
	inst := providercache.NewInstaller(targetDir, source)
	if globalCacheDir != nil {
		inst.SetGlobalCacheDir(globalCacheDir)
	}
	var builtinProviderTypes []string
	for ty := range m.internalProviders() {
		builtinProviderTypes = append(builtinProviderTypes, ty)
	}
	inst.SetBuiltInProviderTypes(builtinProviderTypes)
	unmanagedProviderTypes := make(map[addrs.Provider]struct{}, len(m.UnmanagedProviders))
	for ty := range m.UnmanagedProviders {
		unmanagedProviderTypes[ty] = struct{}{}
	}
	inst.SetUnmanagedProviderTypes(unmanagedProviderTypes)
	return inst
}
func ( m * Meta ) providerInstallerCustomSource ( source getproviders . Source ) * providercache . Installer { targetDir := m . providerLocalCacheDir ( ) globalCacheDir := m . providerGlobalCacheDir ( ) inst := providercache . NewInstaller ( targetDir , source ) if globalCacheDir != nil { inst . SetGlobalCacheDir ( globalCacheDir ) } var builtinProviderTypes [ ] string for ty := range m . internalProviders ( ) { builtinProviderTypes = append ( builtinProviderTypes , ty ) } inst . SetBuiltInProviderTypes ( builtinProviderTypes ) unmanagedProviderTypes := make ( map [ addrs . Provider ] struct { } , len ( m . UnmanagedProviders ) ) for ty := range m . UnmanagedProviders { unmanagedProviderTypes [ ty ] = struct { } { } } inst . SetUnmanagedProviderTypes ( unmanagedProviderTypes ) return inst }
providerInstallerCustomSource is a variant of providerInstaller that
allows the caller to specify a different installation source than the one
that would naturally be selected.
providerInstallerCustomSource is a variant of providerInstaller that allows the caller to specify a different installation source than the one that would naturally be selected .