Skip to content

Commit 9e6514c

Browse files
Bump github.com/hashicorp/terraform-plugin-go from 0.7.1 to 0.8.0 (#900)
* Bump github.com/hashicorp/terraform-plugin-go from 0.7.1 to 0.8.0 Bumps [github.com/hashicorp/terraform-plugin-go](https://github.com/hashicorp/terraform-plugin-go) from 0.7.1 to 0.8.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-go/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-go/blob/main/CHANGELOG.md) - [Commits](hashicorp/terraform-plugin-go@v0.7.1...v0.8.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * all: Update terraform-plugin-log calls due to breaking change * Update CHANGELOG for #900 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brian Flad <[email protected]>
1 parent aeb1360 commit 9e6514c

File tree

7 files changed

+41
-34
lines changed

7 files changed

+41
-34
lines changed

.changelog/900.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
The underlying `terraform-plugin-log` dependency has been updated to v0.3.0, which includes a breaking change in the optional additional fields parameter of logging function calls to ensure correctness and catch coding errors during compilation. Any early adopter provider logging which calls those functions may require updates.
3+
```

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/davecgh/go-spew v1.1.1
1010
github.com/google/go-cmp v0.5.7
1111
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
12-
github.com/hashicorp/go-hclog v1.1.0
12+
github.com/hashicorp/go-hclog v1.2.0
1313
github.com/hashicorp/go-multierror v1.1.1
1414
github.com/hashicorp/go-plugin v1.4.3
1515
github.com/hashicorp/go-uuid v1.0.2
@@ -19,8 +19,8 @@ require (
1919
github.com/hashicorp/logutils v1.0.0
2020
github.com/hashicorp/terraform-exec v0.16.0
2121
github.com/hashicorp/terraform-json v0.13.0
22-
github.com/hashicorp/terraform-plugin-go v0.7.1
23-
github.com/hashicorp/terraform-plugin-log v0.2.1
22+
github.com/hashicorp/terraform-plugin-go v0.8.0
23+
github.com/hashicorp/terraform-plugin-log v0.3.0
2424
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
2525
github.com/kylelemons/godebug v1.1.0 // indirect
2626
github.com/mitchellh/copystructure v1.2.0

go.sum

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
7676
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
7777
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
7878
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
79-
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
8079
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
80+
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
81+
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
82+
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
8183
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
8284
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
8385
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
@@ -100,9 +102,8 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S
100102
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI=
101103
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs=
102104
github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
103-
github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
104-
github.com/hashicorp/go-hclog v1.1.0 h1:QsGcniKx5/LuX2eYoeL+Np3UKYPNaN7YKpTh29h8rbw=
105-
github.com/hashicorp/go-hclog v1.1.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
105+
github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM=
106+
github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
106107
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
107108
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
108109
github.com/hashicorp/go-plugin v1.4.3 h1:DXmvivbWD5qdiBts9TpBC7BYL1Aia5sxbRgQB+v6UZM=
@@ -124,10 +125,10 @@ github.com/hashicorp/terraform-exec v0.16.0 h1:XUh9pJPcbfZsuhReVvmRarQTaiiCnYogF
124125
github.com/hashicorp/terraform-exec v0.16.0/go.mod h1:wB5JHmjxZ/YVNZuv9npAXKmz5pGyxy8PSi0GRR0+YjA=
125126
github.com/hashicorp/terraform-json v0.13.0 h1:Li9L+lKD1FO5RVFRM1mMMIBDoUHslOniyEi5CM+FWGY=
126127
github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9ExU76+cpdY8zHwoazk=
127-
github.com/hashicorp/terraform-plugin-go v0.7.1 h1:sZxEVwqkGxoYFu+vs9NI3qR1s0JGjG5DwV/n8PehIPQ=
128-
github.com/hashicorp/terraform-plugin-go v0.7.1/go.mod h1:gP1vMbBqUmOWdZKJzNSAVr2G5G5pkCIK0Uoih0tqcbw=
129-
github.com/hashicorp/terraform-plugin-log v0.2.1 h1:hl0G6ctSx7DRTE62VNsPWrq7d+JWy1kjk9ApOFrCq3I=
130-
github.com/hashicorp/terraform-plugin-log v0.2.1/go.mod h1:RW/n0x4dyITmenuirZ1ViPQGP5JQdPTZ4Wwc0rLKi94=
128+
github.com/hashicorp/terraform-plugin-go v0.8.0 h1:MvY43PcDj9VlBjYifBWCO/6j1wf106xU8d5Tob/WRs0=
129+
github.com/hashicorp/terraform-plugin-go v0.8.0/go.mod h1:E3GuvfX0Pz2Azcl6BegD6t51StXsVZMOYQoGO8mkHM0=
130+
github.com/hashicorp/terraform-plugin-log v0.3.0 h1:NPENNOjaJSVX0f7JJTl4f/2JKRPQ7S2ZN9B4NSqq5kA=
131+
github.com/hashicorp/terraform-plugin-log v0.3.0/go.mod h1:EjueSP/HjlyFAsDqt+okpCPjkT4NDynAe32AeDC4vps=
131132
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 h1:1FGtlkJw87UsTMg5s8jrekrHmUPUJaMcu6ELiVhQrNw=
132133
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co=
133134
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
@@ -317,8 +318,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8
317318
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
318319
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
319320
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
320-
google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg=
321-
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
321+
google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M=
322+
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
322323
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
323324
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
324325
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -328,8 +329,11 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
328329
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
329330
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
330331
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
331-
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
332332
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
333+
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
334+
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
335+
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
336+
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
333337
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
334338
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
335339
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

helper/resource/testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ func Test(t testing.T, c TestCase) {
635635
defer func(helper *plugintest.Helper) {
636636
err := helper.Close()
637637
if err != nil {
638-
logging.HelperResourceError(ctx, "Unable to clean up temporary test files", logging.KeyError, err)
638+
logging.HelperResourceError(ctx, "Unable to clean up temporary test files", map[string]interface{}{logging.KeyError: err})
639639
}
640640
}(helper)
641641

helper/schema/grpc_provider.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (s *GRPCProviderServer) GetProviderSchema(ctx context.Context, req *tfproto
8383
}
8484

8585
for typ, res := range s.provider.ResourcesMap {
86-
logging.HelperSchemaTrace(ctx, "Found resource type", logging.KeyResourceType, typ)
86+
logging.HelperSchemaTrace(ctx, "Found resource type", map[string]interface{}{logging.KeyResourceType: typ})
8787

8888
resp.ResourceSchemas[typ] = &tfprotov5.Schema{
8989
Version: int64(res.SchemaVersion),
@@ -92,7 +92,7 @@ func (s *GRPCProviderServer) GetProviderSchema(ctx context.Context, req *tfproto
9292
}
9393

9494
for typ, dat := range s.provider.DataSourcesMap {
95-
logging.HelperSchemaTrace(ctx, "Found data source type", logging.KeyDataSourceType, typ)
95+
logging.HelperSchemaTrace(ctx, "Found data source type", map[string]interface{}{logging.KeyDataSourceType: typ})
9696

9797
resp.DataSourceSchemas[typ] = &tfprotov5.Schema{
9898
Version: int64(dat.SchemaVersion),
@@ -482,22 +482,22 @@ func (s *GRPCProviderServer) removeAttributes(ctx context.Context, v interface{}
482482
}
483483

484484
if ty == cty.DynamicPseudoType {
485-
logging.HelperSchemaDebug(ctx, "ignoring dynamic block", "block", v)
485+
logging.HelperSchemaDebug(ctx, "ignoring dynamic block", map[string]interface{}{"block": v})
486486
return
487487
}
488488

489489
if !ty.IsObjectType() {
490490
// This shouldn't happen, and will fail to decode further on, so
491491
// there's no need to handle it here.
492-
logging.HelperSchemaWarn(ctx, "unexpected type for map in JSON state", "type", ty)
492+
logging.HelperSchemaWarn(ctx, "unexpected type for map in JSON state", map[string]interface{}{"type": ty})
493493
return
494494
}
495495

496496
attrTypes := ty.AttributeTypes()
497497
for attr, attrV := range v {
498498
attrTy, ok := attrTypes[attr]
499499
if !ok {
500-
logging.HelperSchemaDebug(ctx, "attribute no longer present in schema", "attribute", attr)
500+
logging.HelperSchemaDebug(ctx, "attribute no longer present in schema", map[string]interface{}{"attribute": attr})
501501
delete(v, attr)
502502
continue
503503
}

internal/logging/helper_resource.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ const (
1212
)
1313

1414
// HelperResourceTrace emits a helper/resource subsystem log at TRACE level.
15-
func HelperResourceTrace(ctx context.Context, msg string, args ...interface{}) {
16-
tfsdklog.SubsystemTrace(ctx, SubsystemHelperResource, msg, args)
15+
func HelperResourceTrace(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
16+
tfsdklog.SubsystemTrace(ctx, SubsystemHelperResource, msg, additionalFields...)
1717
}
1818

1919
// HelperResourceDebug emits a helper/resource subsystem log at DEBUG level.
20-
func HelperResourceDebug(ctx context.Context, msg string, args ...interface{}) {
21-
tfsdklog.SubsystemDebug(ctx, SubsystemHelperResource, msg, args)
20+
func HelperResourceDebug(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
21+
tfsdklog.SubsystemDebug(ctx, SubsystemHelperResource, msg, additionalFields...)
2222
}
2323

2424
// HelperResourceWarn emits a helper/resource subsystem log at WARN level.
25-
func HelperResourceWarn(ctx context.Context, msg string, args ...interface{}) {
26-
tfsdklog.SubsystemWarn(ctx, SubsystemHelperResource, msg, args)
25+
func HelperResourceWarn(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
26+
tfsdklog.SubsystemWarn(ctx, SubsystemHelperResource, msg, additionalFields...)
2727
}
2828

2929
// HelperResourceError emits a helper/resource subsystem log at ERROR level.
30-
func HelperResourceError(ctx context.Context, msg string, args ...interface{}) {
31-
tfsdklog.SubsystemError(ctx, SubsystemHelperResource, msg, args)
30+
func HelperResourceError(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
31+
tfsdklog.SubsystemError(ctx, SubsystemHelperResource, msg, additionalFields...)
3232
}

internal/logging/helper_schema.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ const (
1212
)
1313

1414
// HelperSchemaDebug emits a helper/schema subsystem log at DEBUG level.
15-
func HelperSchemaDebug(ctx context.Context, msg string, args ...interface{}) {
16-
tfsdklog.SubsystemDebug(ctx, SubsystemHelperSchema, msg, args)
15+
func HelperSchemaDebug(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
16+
tfsdklog.SubsystemDebug(ctx, SubsystemHelperSchema, msg, additionalFields...)
1717
}
1818

1919
// HelperSchemaTrace emits a helper/schema subsystem log at TRACE level.
20-
func HelperSchemaTrace(ctx context.Context, msg string, args ...interface{}) {
21-
tfsdklog.SubsystemTrace(ctx, SubsystemHelperSchema, msg, args)
20+
func HelperSchemaTrace(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
21+
tfsdklog.SubsystemTrace(ctx, SubsystemHelperSchema, msg, additionalFields...)
2222
}
2323

2424
// HelperSchemaWarn emits a helper/schema subsystem log at WARN level.
25-
func HelperSchemaWarn(ctx context.Context, msg string, args ...interface{}) {
26-
tfsdklog.SubsystemWarn(ctx, SubsystemHelperSchema, msg, args)
25+
func HelperSchemaWarn(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
26+
tfsdklog.SubsystemWarn(ctx, SubsystemHelperSchema, msg, additionalFields...)
2727
}

0 commit comments

Comments
 (0)