Skip to content

Commit

Permalink
Build with Go 1.21.0 (#33691)
Browse files Browse the repository at this point in the history
* Build with Go 1.21.0

* tests: update tls error message string

Go 1.21 introduced more detailed error conditions for mTLS connections.

As of Go 1.21, if the server is configured to require client auth, but no client cert is provided, the alert is now "certificate required", rather than "bad certificate". See golang/go@62a9948.

* declare go 1.21.0

As of Go 1.21.0, the go directive in go.mod declares a strict minimum
version of Go necessary to use a module. The go command will download a
copy of the newer toolchain if necessary.

* changelog: Go 1.21 supported OS versions

* scripts: pin staticcheck package

The last released version of staticcheck does not yet support Go
1.21.0, so pin to the latest commit.

When a version is released that supports Go 1.21.0, we should pin to
that instead.

* Go 1.21 contrib updates

* bump versions of hcl/v2 and go-cty

This update means that HCL, cty, and Terraform all use Unicode 15.

---------

Co-authored-by: Katy Moe <[email protected]>
Co-authored-by: kmoe <[email protected]>
  • Loading branch information
3 people authored Aug 30, 2023
1 parent 0f2314f commit 91c30fe
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ If you wish to work on the Terraform CLI source code, you'll first need to insta

At this time the Terraform development environment is targeting only Linux and Mac OS X systems. While Terraform itself is compatible with Windows, unfortunately the unit test suite currently contains Unix-specific assumptions around maximum path lengths, path separators, etc.

Refer to the file [`.go-version`](https://github.com/hashicorp/terraform/blob/main/.go-version) to see which version of Go Terraform is currently built with. Other versions will often work, but if you run into any build or testing problems please try with the specific Go version indicated. You can optionally simplify the installation of multiple specific versions of Go on your system by installing [`goenv`](https://github.com/syndbg/goenv), which reads `.go-version` and automatically selects the correct Go version.
Refer to the file [`.go-version`](https://github.com/hashicorp/terraform/blob/main/.go-version) to see which version of Go Terraform is currently built with. As of Go 1.21, the `go` command (e.g. in `go build`) will automatically install the version of the Go toolchain corresponding to the version specified in `go.mod`, if it is newer than the version you have installed. The version in `go.mod` is considered the _minimum_ compatible Go version for Terraform, while the version in `.go-version` is what the production binary is actually built with.

Use Git to clone this repository into a location of your choice. Terraform is using [Go Modules](https://blog.golang.org/using-go-modules), and so you should *not* clone it inside your `GOPATH`.

Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.7
1.21.0
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## 1.6.0 (Unreleased)

UPGRADE NOTES:
* On macOS, Terraform now requires macOS 10.15 Catalina or later; support for previous versions has been discontinued.
* On Windows, Terraform now at least Windows 10 or Windows Server 2016; support for previous versions has been discontinued.
* The S3 backend has a number of significant changes to its configuration format in this release, intended to match with recent changes in the `hashicorp/aws` provider:
* Configuration settings related to assuming IAM roles now belong to a nested block `assume_role`. The top-level arguments `role_arn`, `session_name`, `external_id`, `assume_role_duration_seconds`, `assume_role_policy_arns`, `assume_role_tags`, and `assume_role_transitive_tag_keys` are all now deprecated in favor of the nested equivalents. ([#30495](https://github.com/hashicorp/terraform/issues/30495))
* Configuration settings related to overriding the locations of AWS service endpoints used by the provider now belong to a nested block `endpoints`. The top-level arguments `dynamodb_endpoint`, `iam_endpoint`, `endpoint` (fir S3), and `sts_endpoint` are now deprecated in favor of the nested equivalents. ([#30492](https://github.com/hashicorp/terraform/issues/30492))
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require (
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/hcl/v2 v2.17.1-0.20230825193039-a9f8d65cae3c
github.com/hashicorp/hcl/v2 v2.18.0
github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d
github.com/hashicorp/terraform-registry-address v0.2.0
github.com/hashicorp/terraform-svchost v0.1.1
Expand Down Expand Up @@ -81,7 +81,7 @@ require (
github.com/tombuildsstuff/giovanni v0.15.1
github.com/xanzy/ssh-agent v0.3.1
github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557
github.com/zclconf/go-cty v1.13.3
github.com/zclconf/go-cty v1.14.0
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b
github.com/zclconf/go-cty-yaml v1.0.3
go.opentelemetry.io/contrib/exporters/autoexport v0.0.0-20230703072336-9a582bd098a2
Expand All @@ -96,14 +96,14 @@ require (
golang.org/x/sys v0.11.0
golang.org/x/term v0.11.0
golang.org/x/text v0.12.0
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846
golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5
golang.org/x/tools/cmd/cover v0.1.0-deprecated
google.golang.org/api v0.114.0
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc
google.golang.org/grpc v1.56.1
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
google.golang.org/protobuf v1.31.0
honnef.co/go/tools v0.4.2
honnef.co/go/tools v0.5.0-0.dev.0.20230826160118-ad5ca31ff221
k8s.io/api v0.25.5
k8s.io/apimachinery v0.25.5
k8s.io/client-go v0.25.5
Expand Down Expand Up @@ -135,7 +135,7 @@ require (
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/antchfx/xmlquery v1.3.5 // indirect
github.com/antchfx/xpath v1.1.10 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect
Expand Down Expand Up @@ -271,4 +271,4 @@ require (
sigs.k8s.io/yaml v1.2.0 // indirect
)

go 1.20
go 1.21.0
Loading

0 comments on commit 91c30fe

Please sign in to comment.