mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Remove some unused provider schema abstractions (#1444)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
parent
02e12d054e
commit
c03a4b93f8
@ -155,21 +155,6 @@ func (ctx *BuiltinEvalContext) Provider(addr addrs.AbsProviderConfig) providers.
|
||||
}
|
||||
|
||||
func (ctx *BuiltinEvalContext) ProviderSchema(addr addrs.AbsProviderConfig) (providers.ProviderSchema, error) {
|
||||
// first see if we have already have an initialized provider to avoid
|
||||
// re-loading it only for the schema
|
||||
p := ctx.Provider(addr)
|
||||
if p != nil {
|
||||
resp := p.GetProviderSchema()
|
||||
// convert any diagnostics here in case this is the first call
|
||||
// FIXME: better control provider instantiation so we can be sure this
|
||||
// won't be the first call to ProviderSchema
|
||||
var err error
|
||||
if resp.Diagnostics.HasErrors() {
|
||||
err = resp.Diagnostics.ErrWithWarnings()
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
||||
return ctx.Plugins.ProviderSchema(addr.Provider)
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@ import (
|
||||
"github.com/opentofu/opentofu/internal/addrs"
|
||||
"github.com/opentofu/opentofu/internal/checks"
|
||||
"github.com/opentofu/opentofu/internal/configs"
|
||||
"github.com/opentofu/opentofu/internal/configs/configschema"
|
||||
"github.com/opentofu/opentofu/internal/encryption"
|
||||
"github.com/opentofu/opentofu/internal/instances"
|
||||
"github.com/opentofu/opentofu/internal/plans"
|
||||
@ -58,10 +57,8 @@ type ContextGraphWalker struct {
|
||||
variableValues map[string]map[string]cty.Value
|
||||
variableValuesLock sync.Mutex
|
||||
providerCache map[string]providers.Interface
|
||||
providerSchemas map[string]providers.ProviderSchema
|
||||
providerLock sync.Mutex
|
||||
provisionerCache map[string]provisioners.Interface
|
||||
provisionerSchemas map[string]*configschema.Block
|
||||
provisionerLock sync.Mutex
|
||||
}
|
||||
|
||||
@ -128,9 +125,7 @@ func (w *ContextGraphWalker) EvalContext() EvalContext {
|
||||
func (w *ContextGraphWalker) init() {
|
||||
w.contexts = make(map[string]*BuiltinEvalContext)
|
||||
w.providerCache = make(map[string]providers.Interface)
|
||||
w.providerSchemas = make(map[string]providers.ProviderSchema)
|
||||
w.provisionerCache = make(map[string]provisioners.Interface)
|
||||
w.provisionerSchemas = make(map[string]*configschema.Block)
|
||||
w.variableValues = make(map[string]map[string]cty.Value)
|
||||
|
||||
// Populate root module variable values. Other modules will be populated
|
||||
|
Loading…
Reference in New Issue
Block a user