Skip to content

Commit

Permalink
reflect Reference -> Address refactoring (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Mar 5, 2021
1 parent ef7973c commit 90ae10a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions schema/schema_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
Expand All @@ -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},
},
Expand Down
4 changes: 2 additions & 2 deletions schema/schema_merge_v012_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down
4 changes: 2 additions & 2 deletions schema/schema_merge_v013_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 90ae10a

Please sign in to comment.