diff --git a/go.mod b/go.mod index a373ab49..c0968703 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module github.com/hashicorp/terraform-schema go 1.14 require ( - github.com/google/go-cmp v0.5.4 + github.com/google/go-cmp v0.5.5 github.com/hashicorp/go-multierror v1.1.0 github.com/hashicorp/go-version v1.2.1 - github.com/hashicorp/hcl-lang v0.0.0-20210225075938-01f0b453dd63 + github.com/hashicorp/hcl-lang v0.0.0-20210305083102-791d1fc99bad github.com/hashicorp/hcl/v2 v2.9.0 github.com/hashicorp/terraform-config-inspect v0.0.0-20201102131242-0c45ba392e51 github.com/hashicorp/terraform-json v0.8.0 diff --git a/go.sum b/go.sum index 60f5150b..21a77ba6 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaW github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -31,8 +31,8 @@ github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pB github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= -github.com/hashicorp/hcl-lang v0.0.0-20210225075938-01f0b453dd63 h1:ixUQf+oecfFaMpg6gUNc8LymYKQf+OfmRpxtGL34XtU= -github.com/hashicorp/hcl-lang v0.0.0-20210225075938-01f0b453dd63/go.mod h1:jVqv6gpR2SOPIC6j5HFG/KavqCdfLZED5QitQuV7JTU= +github.com/hashicorp/hcl-lang v0.0.0-20210305083102-791d1fc99bad h1:ynQREphl/QqetQnYIWergBwcuxunJYwhaGxGALgwjzU= +github.com/hashicorp/hcl-lang v0.0.0-20210305083102-791d1fc99bad/go.mod h1:Ga5F2eYh9HyR2eHBYBa49VdoTkkC/7ob1cV8Mpvhg5M= github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= github.com/hashicorp/hcl/v2 v2.9.0 h1:7kJiMiKBqGHASbDJuFAMlpRMJLyhuLg/IsU/3EzwniA= github.com/hashicorp/hcl/v2 v2.9.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= diff --git a/schema/schema_merge.go b/schema/schema_merge.go index 53017b8a..b7e39abd 100644 --- a/schema/schema_merge.go +++ b/schema/schema_merge.go @@ -130,7 +130,7 @@ func (m *SchemaMerger) MergeWithJsonProviderSchemas(ps *tfjson.ProviderSchemas) depKeys.Attributes = append(depKeys.Attributes, schema.AttributeDependent{ Name: "provider", Expr: schema.ExpressionValue{ - Reference: lang.Reference{ + Address: lang.Address{ lang.RootStep{Name: localRef.LocalName}, lang.AttrStep{Name: localRef.Alias}, }, @@ -153,7 +153,7 @@ func (m *SchemaMerger) MergeWithJsonProviderSchemas(ps *tfjson.ProviderSchemas) depKeys.Attributes = append(depKeys.Attributes, schema.AttributeDependent{ Name: "provider", Expr: schema.ExpressionValue{ - Reference: lang.Reference{ + Address: lang.Address{ lang.RootStep{Name: localRef.LocalName}, lang.AttrStep{Name: localRef.Alias}, }, diff --git a/schema/schema_merge_v012_test.go b/schema/schema_merge_v012_test.go index 632e9f25..28820038 100644 --- a/schema/schema_merge_v012_test.go +++ b/schema/schema_merge_v012_test.go @@ -69,7 +69,7 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ }, }, }, - `{"labels":[{"index":0,"value":"null_resource"}],"attrs":[{"name":"provider","expr":{"ref":"null.foobar"}}]}`: { + `{"labels":[{"index":0,"value":"null_resource"}],"attrs":[{"name":"provider","expr":{"addr":"null.foobar"}}]}`: { Detail: "hashicorp/null", Blocks: map[string]*schema.BlockSchema{}, Attributes: map[string]*schema.AttributeSchema{ @@ -562,7 +562,7 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ }, }, }, - `{"labels":[{"index":0,"value":"null_data_source"}],"attrs":[{"name":"provider","expr":{"ref":"null.foobar"}}]}`: { + `{"labels":[{"index":0,"value":"null_data_source"}],"attrs":[{"name":"provider","expr":{"addr":"null.foobar"}}]}`: { Detail: "hashicorp/null", Blocks: map[string]*schema.BlockSchema{}, Attributes: map[string]*schema.AttributeSchema{ diff --git a/schema/schema_merge_v013_test.go b/schema/schema_merge_v013_test.go index 41222a77..bdf64e9d 100644 --- a/schema/schema_merge_v013_test.go +++ b/schema/schema_merge_v013_test.go @@ -253,7 +253,7 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Kind: lang.MarkdownKind, }, }, - `{"labels":[{"index":0,"value":"null_resource"}],"attrs":[{"name":"provider","expr":{"ref":"null.foobar"}}]}`: { + `{"labels":[{"index":0,"value":"null_resource"}],"attrs":[{"name":"provider","expr":{"addr":"null.foobar"}}]}`: { Detail: "hashicorp/null", Blocks: map[string]*schema.BlockSchema{}, Attributes: map[string]*schema.AttributeSchema{ @@ -782,7 +782,7 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Kind: lang.MarkdownKind, }, }, - `{"labels":[{"index":0,"value":"null_data_source"}],"attrs":[{"name":"provider","expr":{"ref":"null.foobar"}}]}`: { + `{"labels":[{"index":0,"value":"null_data_source"}],"attrs":[{"name":"provider","expr":{"addr":"null.foobar"}}]}`: { Detail: "hashicorp/null", Blocks: map[string]*schema.BlockSchema{}, Attributes: map[string]*schema.AttributeSchema{