mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-13 09:32:24 -06:00
47a16b0937
a large refactor to addrs.AbsProviderConfig, embedding the addrs.Provider instead of a Type string. I've added and updated tests, added some Legacy functions to support older state formats and shims, and added a normalization step when reading v4 (current) state files (not the added tests under states/statefile/roundtrip which work with both current and legacy-style AbsProviderConfig strings). The remaining 'fixme' and 'todo' comments are mostly going to be addressed in a subsequent PR and involve looking up a given local provider config's FQN. This is fine for now as we are only working with default assumption.
22 lines
575 B
Go
22 lines
575 B
Go
package terraform
|
|
|
|
// NodeEvalableProvider represents a provider during an "eval" walk.
|
|
// This special provider node type just initializes a provider and
|
|
// fetches its schema, without configuring it or otherwise interacting
|
|
// with it.
|
|
type NodeEvalableProvider struct {
|
|
*NodeAbstractProvider
|
|
}
|
|
|
|
// GraphNodeEvalable
|
|
func (n *NodeEvalableProvider) EvalTree() EvalNode {
|
|
addr := n.Addr
|
|
|
|
return &EvalInitProvider{
|
|
// FIXME: type is now in the AbsProviderConfig, EvalInitProvider doen't
|
|
// need this field anymore
|
|
TypeName: addr.Provider.Type,
|
|
Addr: addr,
|
|
}
|
|
}
|