Skip to content

Commit

Permalink
v5.7.0 (#815)
Browse files Browse the repository at this point in the history
* build: bump go version to 1.20

* doc(CHANGELOG): v5.7.0

* fix: replace math/rand with crypto/rand

* build: use gorelease 1.21.2

* ci: bump go to 1.20.x
  • Loading branch information
Integralist committed Feb 29, 2024
1 parent bd8c5ac commit 080b418
Show file tree
Hide file tree
Showing 9 changed files with 397 additions and 367 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Restore cache
uses: actions/cache@v3
with:
Expand All @@ -29,7 +29,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.19.x]
go-version: [1.20.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Generate Docs
run: |
make generate-docs
Expand All @@ -78,7 +78,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Restore cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Restore cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Restore cache
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Import GPG key
id: import_gpg
uses: fastly/ghaction-import-gpg@v2.1.0
Expand Down
717 changes: 372 additions & 345 deletions CHANGELOG.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"

goreleaser-bin:
go install github.com/goreleaser/goreleaser@v1.18.2
@# This is the last version of goreleaser that supports Go 1.20.14 (the version used to build the provider)
go install github.com/goreleaser/goreleaser@v1.21.2

nilaway:
@nilaway ./...
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
- Mailing list: http://groups.google.com/group/terraform-tool
- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)

Requirements
------------
## Requirements

- [Terraform](https://www.terraform.io/downloads.html) 0.12.x or higher
- [Go](https://golang.org/doc/install) 1.18 (to build the provider plugin)
- [Terraform](https://www.terraform.io/downloads.html) 0.12.x or higher
- [Go](https://golang.org/doc/install) 1.20 (to build the provider plugin)

> NOTE: the last version of the Fastly provider to support Terraform 0.11.x and below was [v0.26.0](https://github.com/fastly/terraform-provider-fastly/releases/tag/v0.26.0)
Expand All @@ -31,7 +30,7 @@ $ make build

## Developing the Provider

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.18+ is *required*).
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.20+ is *required*).

To compile the provider, run `make build`. This will build the provider and put the provider binary in a local `bin` directory.

Expand All @@ -43,7 +42,7 @@ $ make build
Alongside the newly built binary a file called `developer_overrides.tfrc` will be created. The `make build` target will communicate
back details for setting the `TF_CLI_CONFIG_FILE` environment variable that will enable Terraform to use your locally built provider binary.

* HashiCorp - [Development Overrides for Provider developers](https://www.terraform.io/docs/cli/config/config-file.html#development-overrides-for-provider-developers).
- HashiCorp - [Development Overrides for Provider developers](https://www.terraform.io/docs/cli/config/config-file.html#development-overrides-for-provider-developers).

> **NOTE**: If you have issues seeing any behaviours from code changes you've made to the provider, then it might be the terraform CLI is getting confused by which provider binary it should be using. Check inside the `./bin/` directory to see if there are multiple providers with different commit hashes (e.g. `terraform-provider-fastly_v2.2.0-5-gfdc37cee`) and delete them first before running `make build`. This should help the Terraform CLI resolve to the correct binary.
Expand Down Expand Up @@ -87,6 +86,7 @@ Then use Terraform as usual, and it will automatically use the provider in the d
$ export TF_REATTACH_PROVIDERS='{"fastly/fastly":{"Protocol":"grpc","Pid":54132,"Test":true,"Addr":{"Network":"unix","String":"/var/folders/qm/swg2hf4h5t8sdht8yhds4dg6m0000gn/T/plugin865249851"}}}'
$ terraform plan
```

You will then be able to set breakpoints and trace the provider's execution using the debugger as you would expect.

The implementation for setting up debug mode presumes Terraform 0.13.x is being used. If you're using Terraform 0.12.x you'll need to manually modify the value assigned to `TF_REATTACH_PROVIDERS` so that the key `"fastly/fastly"` becomes `"registry.terraform.io/-/fastly"`. See HashiCorp's ["Support for Debuggable Provider Binaries"](https://www.terraform.io/docs/extend/guides/v2-upgrade-guide.html#support-for-debuggable-provider-binaries) for more details.
Expand Down Expand Up @@ -160,18 +160,20 @@ Building the documentation copies the full markdown into the `docs` folder, read

> NOTE: you'll need the [`tfplugindocs`](https://github.com/hashicorp/terraform-plugin-docs) tool for generating the Markdown to be deployed to Hashicorp. For more information on generating documentation, refer to https://www.terraform.io/docs/registry/providers/docs.html
* To validate the `/template` directory structure:
- To validate the `/template` directory structure:

```
make validate-docs
```

* To build the `/docs` documentation Markdown files:
- To build the `/docs` documentation Markdown files:

```
make generate-docs
```

* To view the documentation:
Paste `/docs` Markdown file content into https://registry.terraform.io/tools/doc-preview
- To view the documentation:
Paste `/docs` Markdown file content into https://registry.terraform.io/tools/doc-preview

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ terraform {
required_providers {
fastly = {
source = "fastly/fastly"
version = ">= 5.6.0"
version = ">= 5.7.0"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion fastly/data_source_services_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package fastly

import (
"crypto/rand"
"encoding/hex"
"fmt"
"math/rand"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
Expand Down
2 changes: 1 addition & 1 deletion fastly/resource_fastly_service_authorization_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package fastly

import (
"crypto/rand"
"encoding/hex"
"fmt"
"math/rand"
"testing"

gofastly "github.com/fastly/go-fastly/v9/fastly"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/fastly/terraform-provider-fastly

go 1.18
go 1.20

require (
github.com/bflad/tfproviderlint v0.29.0
Expand Down

0 comments on commit 080b418

Please sign in to comment.