Move dag/ to internal/dag/

This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.

If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.
This commit is contained in:
Martin Atkins 2021-05-17 09:30:37 -07:00
parent cf93aa8046
commit 70eebe3521
61 changed files with 45 additions and 45 deletions

View File

@ -7,8 +7,8 @@ import (
"github.com/hashicorp/terraform/plans/planfile" "github.com/hashicorp/terraform/plans/planfile"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
"github.com/hashicorp/terraform/dag"
"github.com/hashicorp/terraform/internal/backend" "github.com/hashicorp/terraform/internal/backend"
"github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
) )

View File

@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// Graph represents the graph that Terraform uses to represent resources // Graph represents the graph that Terraform uses to represent resources

View File

@ -3,7 +3,7 @@ package terraform
import ( import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/plans" "github.com/hashicorp/terraform/plans"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"

View File

@ -3,7 +3,7 @@ package terraform
import ( import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
) )

View File

@ -3,7 +3,7 @@ package terraform
import ( import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
) )

View File

@ -3,7 +3,7 @@ package terraform
import ( import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
) )

View File

@ -5,7 +5,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
) )

View File

@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
func TestBasicGraphBuilder_impl(t *testing.T) { func TestBasicGraphBuilder_impl(t *testing.T) {

View File

@ -1,7 +1,7 @@
package terraform package terraform
import ( import (
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// ValidateGraphBuilder creates the graph for the validate operation. // ValidateGraphBuilder creates the graph for the validate operation.

View File

@ -1,6 +1,6 @@
package terraform package terraform
import "github.com/hashicorp/terraform/dag" import "github.com/hashicorp/terraform/internal/dag"
// GraphDot returns the dot formatting of a visual representation of // GraphDot returns the dot formatting of a visual representation of
// the given Terraform graph. // the given Terraform graph.

View File

@ -4,7 +4,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
func TestGraphDot(t *testing.T) { func TestGraphDot(t *testing.T) {

View File

@ -3,7 +3,7 @@ package terraform
import ( import (
"testing" "testing"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// testGraphContains is an assertion helper that tests that a node is // testGraphContains is an assertion helper that tests that a node is

View File

@ -7,7 +7,7 @@ import (
"github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/lang" "github.com/hashicorp/terraform/lang"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"

View File

@ -5,7 +5,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/lang" "github.com/hashicorp/terraform/lang"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
) )

View File

@ -7,8 +7,8 @@ import (
"github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag"
"github.com/hashicorp/terraform/instances" "github.com/hashicorp/terraform/instances"
"github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/lang" "github.com/hashicorp/terraform/lang"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"

View File

@ -7,7 +7,7 @@ import (
"github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/lang" "github.com/hashicorp/terraform/lang"
"github.com/hashicorp/terraform/plans" "github.com/hashicorp/terraform/plans"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"

View File

@ -5,7 +5,7 @@ import (
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// ConcreteProviderNodeFunc is a callback type used to convert an // ConcreteProviderNodeFunc is a callback type used to convert an

View File

@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/lang" "github.com/hashicorp/terraform/lang"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"

View File

@ -4,7 +4,7 @@ import (
"log" "log"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/lang" "github.com/hashicorp/terraform/lang"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
) )

View File

@ -5,7 +5,7 @@ import (
"log" "log"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/plans" "github.com/hashicorp/terraform/plans"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"

View File

@ -6,7 +6,7 @@ import (
"strings" "strings"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
) )

View File

@ -3,7 +3,7 @@ package terraform
import ( import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
) )

View File

@ -3,7 +3,7 @@ package terraform
import ( import (
"log" "log"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/internal/logging" "github.com/hashicorp/terraform/internal/logging"
) )

View File

@ -4,7 +4,7 @@ import (
"log" "log"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// GraphNodeAttachResourceConfig is an interface that must be implemented by nodes // GraphNodeAttachResourceConfig is an interface that must be implemented by nodes

View File

@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// GraphNodeAttachResourceSchema is an interface implemented by node types // GraphNodeAttachResourceSchema is an interface implemented by node types

View File

@ -3,7 +3,7 @@ package terraform
import ( import (
"log" "log"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
) )

View File

@ -5,7 +5,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// ConfigTransformer is a GraphTransformer that adds all the resources // ConfigTransformer is a GraphTransformer that adds all the resources

View File

@ -2,7 +2,7 @@ package terraform
import ( import (
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// CountBoundaryTransformer adds a node that depends on everything else // CountBoundaryTransformer adds a node that depends on everything else

View File

@ -5,7 +5,7 @@ import (
"log" "log"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
) )

View File

@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// GraphNodeDestroyer must be implemented by nodes that destroy resources. // GraphNodeDestroyer must be implemented by nodes that destroy resources.

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/plans" "github.com/hashicorp/terraform/plans"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"

View File

@ -5,7 +5,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// ModuleExpansionTransformer is a GraphTransformer that adds graph nodes // ModuleExpansionTransformer is a GraphTransformer that adds graph nodes

View File

@ -4,7 +4,7 @@ import (
"log" "log"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
) )

View File

@ -4,7 +4,7 @@ import (
"log" "log"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
) )

View File

@ -6,7 +6,7 @@ import (
"testing" "testing"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/states"
) )

View File

@ -5,7 +5,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/plans" "github.com/hashicorp/terraform/plans"
) )

View File

@ -7,7 +7,7 @@ import (
"github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
) )

View File

@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
func testProviderTransformerGraph(t *testing.T, cfg *configs.Config) *Graph { func testProviderTransformerGraph(t *testing.T, cfg *configs.Config) *Graph {

View File

@ -8,7 +8,7 @@ import (
"github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/lang" "github.com/hashicorp/terraform/lang"
) )

View File

@ -7,7 +7,7 @@ import (
"testing" "testing"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
func TestReferenceTransformer_simple(t *testing.T) { func TestReferenceTransformer_simple(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// ResourceCountTransformer is a GraphTransformer that expands the count // ResourceCountTransformer is a GraphTransformer that expands the count

View File

@ -1,7 +1,7 @@
package terraform package terraform
import ( import (
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
const rootNodeName = "root" const rootNodeName = "root"

View File

@ -4,7 +4,7 @@ import (
"log" "log"
"github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// GraphNodeTargetable is an interface for graph nodes to implement when they // GraphNodeTargetable is an interface for graph nodes to implement when they

View File

@ -3,7 +3,7 @@ package terraform
import ( import (
"fmt" "fmt"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
// VertexTransformer is a GraphTransformer that transforms vertices // VertexTransformer is a GraphTransformer that transforms vertices

View File

@ -4,7 +4,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/internal/dag"
) )
func TestVertexTransformer_impl(t *testing.T) { func TestVertexTransformer_impl(t *testing.T) {