Skip to content

Commit

Permalink
Merge pull request #1087 from hashicorp/go-bump
Browse files Browse the repository at this point in the history
Update go versions to 1.21.8
  • Loading branch information
dduzgun-security committed Mar 19, 2024
2 parents 22add65 + 59afc25 commit cedebee
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 35 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:
# Push events on main branch
- main
# Push events to branches matching refs/heads/release/**
- 'release/**'

- "release/**"

env:
PKG_NAME: "consul-terraform-sync"
Expand All @@ -29,14 +28,14 @@ jobs:
run: |
make version
echo "::set-output name=product-version::$(make version)"
generate-metadata-file:
needs: get-product-version
runs-on: ubuntu-latest
outputs:
filepath: ${{ steps.generate-metadata-file.outputs.filepath }}
steps:
- name: 'Checkout directory'
- name: "Checkout directory"
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Generate metadata file
id: generate-metadata-file
Expand All @@ -57,7 +56,7 @@ jobs:
ldflags: ${{ steps.generate-ld-flags.outputs.ldflags }}
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: 'Generate ld flags'
- name: "Generate ld flags"
id: generate-ld-flags
run: |
project="$(go list -m)"
Expand All @@ -71,15 +70,15 @@ jobs:
strategy:
matrix:
include:
- {go: "1.20.10", goos: "linux", goarch: "386"}
- {go: "1.20.10", goos: "linux", goarch: "amd64"}
- {go: "1.20.10", goos: "linux", goarch: "arm"}
- {go: "1.20.10", goos: "linux", goarch: "arm64"}
- {go: "1.20.10", goos: "freebsd", goarch: "386"}
- {go: "1.20.10", goos: "freebsd", goarch: "amd64"}
- {go: "1.20.10", goos: "windows", goarch: "386"}
- {go: "1.20.10", goos: "windows", goarch: "amd64"}
- {go: "1.20.10", goos: "solaris", goarch: "amd64"}
- { go: "1.21.8", goos: "linux", goarch: "386" }
- { go: "1.21.8", goos: "linux", goarch: "amd64" }
- { go: "1.21.8", goos: "linux", goarch: "arm" }
- { go: "1.21.8", goos: "linux", goarch: "arm64" }
- { go: "1.21.8", goos: "freebsd", goarch: "386" }
- { go: "1.21.8", goos: "freebsd", goarch: "amd64" }
- { go: "1.21.8", goos: "windows", goarch: "386" }
- { go: "1.21.8", goos: "windows", goarch: "amd64" }
- { go: "1.21.8", goos: "solaris", goarch: "amd64" }
fail-fast: true

name: Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build
Expand Down Expand Up @@ -147,7 +146,7 @@ jobs:
matrix:
goos: [darwin]
goarch: ["amd64"]
go: ["1.20.10"]
go: ["1.21.8"]
fail-fast: true

name: Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build
Expand All @@ -166,7 +165,7 @@ jobs:
go-version: ${{ matrix.go }}

- name: Build
env:
env:
GO_TAGS: "${{ env.GO_TAGS }} netcgo"
run: |
mkdir dist out
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ on:
pull_request:
branches:
- main
- 'release/**'
- "release/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
GO_VERSION: 1.20.10
GO_VERSION: 1.21.8
CONSUL_VERSION: 1.12.1
TERRAFORM_VERSION: 1.6.2
TERRAFORM_VERSION: 1.7.5

jobs:
run-check:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
version: ${{ env.CONSUL_VERSION }}

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}

Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
version: ${{ env.CONSUL_VERSION }}

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/weekly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ name: Weekly Tests
on:
workflow_dispatch:
schedule:
- cron: '10 2 * * 3'
- cron: "10 2 * * 3"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
GO_VERSION: 1.20.10
GO_VERSION: 1.21.8
CONSUL_VERSION: 1.12.1
TERRAFORM_VERSION: 1.6.2
TERRAFORM_VERSION: 1.7.5
VAULT_VERSION: 1.10.3

jobs:
Expand Down
2 changes: 1 addition & 1 deletion examples/reference-example/sync-tasks/my-task/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Description: automate services for website X

terraform {
required_version = ">= 0.13.0, <= 1.6.2"
required_version = ">= 0.13.0, <= 1.7.5"
required_providers {
myprovider = {
source = "namespace/myprovider"
Expand Down
12 changes: 6 additions & 6 deletions templates/tftmpl/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ func TestAppendRootTerraformBlock_backend(t *testing.T) {
"nil",
nil,
`terraform {
required_version = ">= 0.13.0, <= 1.6.2"
required_version = ">= 0.13.0, <= 1.7.5"
}
`,
}, {
"empty",
map[string]interface{}{"empty": map[string]interface{}{}},
`terraform {
required_version = ">= 0.13.0, <= 1.6.2"
required_version = ">= 0.13.0, <= 1.7.5"
backend "empty" {
}
}
Expand All @@ -48,7 +48,7 @@ func TestAppendRootTerraformBlock_backend(t *testing.T) {
"invalid structure",
map[string]interface{}{"invalid": "unexpected type"},
`terraform {
required_version = ">= 0.13.0, <= 1.6.2"
required_version = ">= 0.13.0, <= 1.7.5"
}
`,
}, {
Expand All @@ -57,7 +57,7 @@ func TestAppendRootTerraformBlock_backend(t *testing.T) {
"path": "relative/path/to/terraform.tfstate",
}},
`terraform {
required_version = ">= 0.13.0, <= 1.6.2"
required_version = ">= 0.13.0, <= 1.7.5"
backend "local" {
path = "relative/path/to/terraform.tfstate"
}
Expand All @@ -67,7 +67,7 @@ func TestAppendRootTerraformBlock_backend(t *testing.T) {
"consul",
consulBackend,
`terraform {
required_version = ">= 0.13.0, <= 1.6.2"
required_version = ">= 0.13.0, <= 1.7.5"
backend "consul" {
address = "consul.example.com"
ca_file = "ca_cert"
Expand All @@ -85,7 +85,7 @@ func TestAppendRootTerraformBlock_backend(t *testing.T) {
"conn_str": "postgres://user:pass@db.example.com/terraform_backend",
}},
`terraform {
required_version = ">= 0.13.0, <= 1.6.2"
required_version = ">= 0.13.0, <= 1.7.5"
backend "pg" {
conn_str = "postgres://user:pass@db.example.com/terraform_backend"
}
Expand Down
2 changes: 1 addition & 1 deletion templates/tftmpl/testdata/catalog-services/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Description: user description for task named 'test'

terraform {
required_version = ">= 0.13.0, <= 1.6.2"
required_version = ">= 0.13.0, <= 1.7.5"
}


Expand Down
2 changes: 1 addition & 1 deletion templates/tftmpl/testdata/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Description: user description for task named 'test'

terraform {
required_version = ">= 0.13.0, <= 1.6.2"
required_version = ">= 0.13.0, <= 1.7.5"
required_providers {
testProvider = {
source = "namespace/testProvider"
Expand Down
2 changes: 1 addition & 1 deletion version/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// account for. The upper bound may be removed once CTS has protocols
// set in place for compatible modules and can handle Terraform syntax changes
// and enhancements between versions.
const CompatibleTerraformVersionConstraint = ">= 0.13.0, <= 1.6.2"
const CompatibleTerraformVersionConstraint = ">= 0.13.0, <= 1.7.5"

// TerraformConstraint is the go-version constraint variable for
// CompatibleTerraformVersionConstraint
Expand Down
2 changes: 1 addition & 1 deletion version/terraform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestTerraformConstraint(t *testing.T) {
false,
}, {
"invalid upper bound",
"1.6.3",
"1.8.0",
false,
}, {
"unsupported beta release",
Expand Down

0 comments on commit cedebee

Please sign in to comment.