From a89fc75d5922c4ed0684560959c428b83ae22e08 Mon Sep 17 00:00:00 2001 From: Jakub Date: Thu, 9 May 2024 13:29:50 +0200 Subject: [PATCH 1/4] Updated docs to consider legacy space not being present Signed-off-by: Jakub --- docs/resources/idp_group_mapping.md | 4 ---- docs/resources/stack.md | 2 +- examples/resources/spacelift_idp_group_mapping/resource.tf | 4 ---- spacelift/data_spaces_test.go | 2 +- spacelift/resource_stack.go | 2 +- 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/docs/resources/idp_group_mapping.md b/docs/resources/idp_group_mapping.md index 28e6c1f3..f5a9b8a0 100644 --- a/docs/resources/idp_group_mapping.md +++ b/docs/resources/idp_group_mapping.md @@ -19,10 +19,6 @@ resource "spacelift_idp_group_mapping" "test" { space_id = "root" role = "ADMIN" } - policy { - space_id = "legacy" - role = "ADMIN" - } } ``` diff --git a/docs/resources/stack.md b/docs/resources/stack.md index bb5bf5cd..89db9a09 100644 --- a/docs/resources/stack.md +++ b/docs/resources/stack.md @@ -247,7 +247,7 @@ resource "spacelift_stack" "terragrunt-stack" { - `runner_image` (String) Name of the Docker image used to process Runs - `showcase` (Block List, Max: 1) (see [below for nested schema](#nestedblock--showcase)) - `slug` (String) Allows setting the custom ID (slug) for the stack -- `space_id` (String) ID (slug) of the space the stack is in. Defaults to `legacy`. +- `space_id` (String) ID (slug) of the space the stack is in. Defaults to `legacy` if it exists, otherwise `root`. - `terraform_external_state_access` (Boolean) Indicates whether you can access the Stack state file from other stacks or outside of Spacelift. Defaults to `false`. - `terraform_smart_sanitization` (Boolean) Indicates whether runs on this will use terraform's sensitive value system to sanitize the outputs of Terraform state and plans in spacelift instead of sanitizing all fields. Note: Requires the terraform version to be v1.0.1 or above. Defaults to `false`. - `terraform_version` (String) Terraform version to use diff --git a/examples/resources/spacelift_idp_group_mapping/resource.tf b/examples/resources/spacelift_idp_group_mapping/resource.tf index d9f9098b..9cd18fae 100644 --- a/examples/resources/spacelift_idp_group_mapping/resource.tf +++ b/examples/resources/spacelift_idp_group_mapping/resource.tf @@ -4,8 +4,4 @@ resource "spacelift_idp_group_mapping" "test" { space_id = "root" role = "ADMIN" } - policy { - space_id = "legacy" - role = "ADMIN" - } } diff --git a/spacelift/data_spaces_test.go b/spacelift/data_spaces_test.go index 7a6fd28f..c45a1e55 100644 --- a/spacelift/data_spaces_test.go +++ b/spacelift/data_spaces_test.go @@ -13,7 +13,7 @@ func TestSpacesData(t *testing.T) { datasourceName := "data.spacelift_spaces.test" testSteps(t, []resource.TestStep{{ - // Should find at least the legacy and root spaces. + // Should find at least root space. Config: ` data "spacelift_spaces" "test" { } diff --git a/spacelift/resource_stack.go b/spacelift/resource_stack.go index 8e809b87..b0fffd5c 100644 --- a/spacelift/resource_stack.go +++ b/spacelift/resource_stack.go @@ -546,7 +546,7 @@ func resourceStack() *schema.Resource { }, "space_id": { Type: schema.TypeString, - Description: "ID (slug) of the space the stack is in. Defaults to `legacy`.", + Description: "ID (slug) of the space the stack is in. Defaults to `legacy` if it exists, otherwise `root`.", Optional: true, Computed: true, }, From 8a90a600abd0335b99a71f1d006e8ef8c58f706a Mon Sep 17 00:00:00 2001 From: Peter Deme Date: Fri, 17 May 2024 10:21:54 +0200 Subject: [PATCH 2/4] Chore: bump to Go v1.22; bump GitHub Action package versions (#554) * Chore: bump GitHub Action package versions * Bump to Go v1.22 Signed-off-by: peterdeme --------- Signed-off-by: peterdeme --- .github/workflows/analysis-codeql.yml | 4 + .github/workflows/analysis-gosec.yml | 2 +- .github/workflows/analysis-lint.yml | 5 +- .github/workflows/check-documentation.yml | 7 +- .github/workflows/release-beta.yml | 11 +- .github/workflows/release.yml | 10 +- .github/workflows/test-prod.yml | 7 +- .github/workflows/test.yml | 7 +- README.md | 2 +- go.mod | 60 +++---- go.sum | 161 +++++++++--------- tools/go.mod | 50 +++--- tools/go.sum | 188 ++++++++++++---------- 13 files changed, 259 insertions(+), 255 deletions(-) diff --git a/.github/workflows/analysis-codeql.yml b/.github/workflows/analysis-codeql.yml index ff4c3457..9bca6ace 100644 --- a/.github/workflows/analysis-codeql.yml +++ b/.github/workflows/analysis-codeql.yml @@ -17,6 +17,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: { go-version-file: go.mod } + - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: diff --git a/.github/workflows/analysis-gosec.yml b/.github/workflows/analysis-gosec.yml index 61ba6f25..02a5afed 100644 --- a/.github/workflows/analysis-gosec.yml +++ b/.github/workflows/analysis-gosec.yml @@ -25,6 +25,6 @@ jobs: args: "-severity=medium -no-fail -fmt sarif -out gosec-results.sarif ./..." - name: Upload GoSec scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v1 + uses: github/codeql-action/upload-sarif@v2 with: sarif_file: "gosec-results.sarif" diff --git a/.github/workflows/analysis-lint.yml b/.github/workflows/analysis-lint.yml index 47430585..9a574574 100644 --- a/.github/workflows/analysis-lint.yml +++ b/.github/workflows/analysis-lint.yml @@ -14,9 +14,8 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: "1.21" + uses: actions/setup-go@v5 + with: { go-version-file: go.mod } - name: Check formatting using gofmt run: gofmt -s -l -d . diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index e1c9b502..5227a700 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -18,15 +18,14 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: "1.21" + uses: actions/setup-go@v5 + with: { go-version-file: go.mod } - name: Generate documentation run: cd tools && go generate ./... - name: Verify Changed files - uses: tj-actions/verify-changed-files@v15 + uses: tj-actions/verify-changed-files@v20 id: verify-changed-files with: files: | diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 819e1312..49d172c8 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -36,20 +36,19 @@ jobs: echo -e "project_name: terraform-provider-${{ inputs.providerType }}\n$(cat .goreleaser.yml)" > .goreleaser.yml - name: Set up Go - uses: actions/setup-go@v4 - with: { go-version: 1.21 } + uses: actions/setup-go@v5 + with: { go-version-file: go.mod } - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@v5 + uses: crazy-max/ghaction-import-gpg@v6 id: import_gpg with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Run GoReleaser to create draft release - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v5 with: - version: latest args: release --clean --snapshot env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} @@ -57,8 +56,6 @@ jobs: - name: Install spacectl uses: spacelift-io/setup-spacectl@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Release to Spacelift registry (preprod) run: spacectl provider create-version --type=${{ inputs.providerType }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a9dff33..cb597252 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,18 +19,18 @@ jobs: run: git fetch --prune --unshallow - name: Set up Go - uses: actions/setup-go@v4 - with: { go-version: 1.21 } + uses: actions/setup-go@v5 + with: { go-version-file: go.mod } - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@v5 + uses: crazy-max/ghaction-import-gpg@v6 id: import_gpg with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Run GoReleaser to create draft release - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v5 with: version: latest args: release --clean @@ -40,8 +40,6 @@ jobs: - name: Install spacectl uses: spacelift-io/setup-spacectl@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Release to Spacelift registry (preprod) run: spacectl provider create-version --type=spacelift diff --git a/.github/workflows/test-prod.yml b/.github/workflows/test-prod.yml index 1ad08aec..3a1e2b6d 100644 --- a/.github/workflows/test-prod.yml +++ b/.github/workflows/test-prod.yml @@ -14,12 +14,11 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: "1.21" + uses: actions/setup-go@v5 + with: { go-version-file: go.mod } - name: Install Terraform - uses: hashicorp/setup-terraform@v2 + uses: hashicorp/setup-terraform@v3 with: terraform_wrapper: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 35768853..4b90503b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,12 +16,11 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: "1.21" + uses: actions/setup-go@v5 + with: { go-version-file: go.mod } - name: Install Terraform - uses: hashicorp/setup-terraform@v2 + uses: hashicorp/setup-terraform@v3 with: terraform_wrapper: false diff --git a/README.md b/README.md index a825cd05..15f163a0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ If you want to build from source, you can simply use `go build` in the root of t To develop the provider locally you need the following tools: -- [Go 1.21](https://go.dev/doc/install). +- [Go 1.22](https://go.dev/doc/install). - [GoReleaser](https://goreleaser.com/). - A Spacelift account to use for testing. diff --git a/go.mod b/go.mod index e1806895..b170d77f 100644 --- a/go.mod +++ b/go.mod @@ -1,47 +1,47 @@ module github.com/spacelift-io/terraform-provider-spacelift -go 1.21 +go 1.22 require ( github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 - github.com/hashicorp/go-retryablehttp v0.7.4 + github.com/hashicorp/go-retryablehttp v0.7.6 github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/pkg/errors v0.9.1 - github.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a - golang.org/x/oauth2 v0.13.0 - golang.org/x/time v0.3.0 + github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 + golang.org/x/oauth2 v0.20.0 + golang.org/x/time v0.5.0 ) require ( - github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect + github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect github.com/agext/levenshtein v1.2.2 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/fatih/color v1.13.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.5.1 // indirect + github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/hc-install v0.6.0 // indirect - github.com/hashicorp/hcl/v2 v2.18.0 // indirect + github.com/hashicorp/hc-install v0.6.3 // indirect + github.com/hashicorp/hcl/v2 v2.19.1 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.19.0 // indirect - github.com/hashicorp/terraform-json v0.17.1 // indirect - github.com/hashicorp/terraform-plugin-go v0.19.0 // indirect - github.com/hashicorp/terraform-registry-address v0.2.2 // indirect + github.com/hashicorp/terraform-exec v0.20.0 // indirect + github.com/hashicorp/terraform-json v0.21.0 // indirect + github.com/hashicorp/terraform-plugin-go v0.22.0 // indirect + github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect - github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect @@ -49,18 +49,18 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/zclconf/go-cty v1.14.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.16.0 // indirect - golang.org/x/sys v0.15.0 // indirect + github.com/zclconf/go-cty v1.14.2 // indirect + golang.org/x/crypto v0.19.0 // indirect + golang.org/x/mod v0.15.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect - google.golang.org/grpc v1.57.1 // indirect - google.golang.org/protobuf v1.33.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/grpc v1.61.1 // indirect + google.golang.org/protobuf v1.32.0 // indirect ) replace github.com/shurcooL/graphql => github.com/spacelift-io/graphql v1.2.0 diff --git a/go.sum b/go.sum index 8f7ca808..830aaf63 100644 --- a/go.sum +++ b/go.sum @@ -2,10 +2,8 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= -github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= +github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE9N5vPhgY2I+j0= +github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= @@ -13,10 +11,10 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -24,27 +22,28 @@ github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 h1:CaO/zOnF8VvUfEbhRatPcwKVWamvbY github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= -github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= -github.com/go-git/go-git/v5 v5.8.1 h1:Zo79E4p7TRk0xoRgMq0RShiTHGKcKI4+DI6BfJc/Q+A= -github.com/go-git/go-git/v5 v5.8.1/go.mod h1:FHFuoD6yGz5OSKEBK+aWN9Oah0q54Jxl0abmj6GnqAo= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= +github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= @@ -54,42 +53,41 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBYo+6k= -github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= -github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= -github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= +github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= +github.com/hashicorp/go-retryablehttp v0.7.6 h1:TwRYfx2z2C4cLbXmT8I5PgP/xmuqASDyiVuGYfs9GZM= +github.com/hashicorp/go-retryablehttp v0.7.6/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.6.0 h1:fDHnU7JNFNSQebVKYhHZ0va1bC6SrPQ8fpebsvNr2w4= -github.com/hashicorp/hc-install v0.6.0/go.mod h1:10I912u3nntx9Umo1VAeYPUUuehk0aRQJYpMwbX5wQA= -github.com/hashicorp/hcl/v2 v2.18.0 h1:wYnG7Lt31t2zYkcquwgKo6MWXzRUDIeIVU5naZwHLl8= -github.com/hashicorp/hcl/v2 v2.18.0/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= +github.com/hashicorp/hc-install v0.6.3 h1:yE/r1yJvWbtrJ0STwScgEnCanb0U9v7zp0Gbkmcoxqs= +github.com/hashicorp/hc-install v0.6.3/go.mod h1:KamGdbodYzlufbWh4r9NRo8y6GLHWZP2GBtdnms1Ln0= +github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= +github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= -github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= -github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= -github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= -github.com/hashicorp/terraform-plugin-go v0.19.0 h1:BuZx/6Cp+lkmiG0cOBk6Zps0Cb2tmqQpDM3iAtnhDQU= -github.com/hashicorp/terraform-plugin-go v0.19.0/go.mod h1:EhRSkEPNoylLQntYsk5KrDHTZJh9HQoumZXbOGOXmec= +github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= +github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= +github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= +github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= +github.com/hashicorp/terraform-plugin-go v0.22.0 h1:1OS1Jk5mO0f5hrziWJGXXIxBrMe2j/B8E+DVGw43Xmc= +github.com/hashicorp/terraform-plugin-go v0.22.0/go.mod h1:mPULV91VKss7sik6KFEcEu7HuTogMLLO/EvWCuFkRVE= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 h1:wcOKYwPI9IorAJEBLzgclh3xVolO7ZorYd6U1vnok14= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0/go.mod h1:qH/34G25Ugdj5FcM95cSoXzUgIbgfhVLXCcEcYaMwq8= -github.com/hashicorp/terraform-registry-address v0.2.2 h1:lPQBg403El8PPicg/qONZJDC6YlgCVbWDtNmmZKtBno= -github.com/hashicorp/terraform-registry-address v0.2.2/go.mod h1:LtwNbCihUoUZ3RYriyS2wF/lGPB6gF9ICLRtuDk7hSo= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh3R4yp6pKksKHcqZx5G8= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A= +github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= +github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= @@ -106,11 +104,14 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -131,53 +132,43 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= -github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo= +github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= +github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/spacelift-io/graphql v1.2.0 h1:oUS1fyO4cqMGOcydu26BVbZkTf/pdDnLWVal6lYv49Q= github.com/spacelift-io/graphql v1.2.0/go.mod h1:Q/JMkvFWF8uXZQkDn8i9Nc3aXucbgTFeuFZ6WQMt0Wg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.0 h1:/Xrd39K7DXbHzlisFP9c4pHao4yyf+/Ug9LEz+Y/yhc= -github.com/zclconf/go-cty v1.14.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.2 h1:kTG7lqmBou0Zkx35r6HJHUQTvaRPr5bIAf3AoHS0izI= +github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= -golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -188,54 +179,46 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= -google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= +google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/go.mod b/tools/go.mod index 24d68d71..766c4579 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,44 +1,52 @@ module tools -go 1.21 +go 1.22 -require github.com/hashicorp/terraform-plugin-docs v0.16.0 +require github.com/hashicorp/terraform-plugin-docs v0.19.2 require ( + github.com/BurntSushi/toml v1.2.1 // indirect + github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.1.1 // indirect - github.com/Masterminds/sprig/v3 v3.2.2 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect - github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect + github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect - github.com/cloudflare/circl v1.3.3 // indirect - github.com/fatih/color v1.13.0 // indirect + github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/google/uuid v1.3.0 // indirect + github.com/hashicorp/cli v1.1.6 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/hc-install v0.5.2 // indirect - github.com/hashicorp/terraform-exec v0.18.1 // indirect - github.com/hashicorp/terraform-json v0.17.1 // indirect - github.com/huandu/xstrings v1.3.2 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/hashicorp/hc-install v0.6.4 // indirect + github.com/hashicorp/terraform-exec v0.20.0 // indirect + github.com/hashicorp/terraform-json v0.21.0 // indirect + github.com/huandu/xstrings v1.3.3 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect - github.com/mitchellh/cli v1.1.5 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/posener/complete v1.2.3 // indirect - github.com/russross/blackfriday v1.6.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect - github.com/zclconf/go-cty v1.13.2 // indirect - golang.org/x/crypto v0.8.0 // indirect + github.com/yuin/goldmark v1.7.1 // indirect + github.com/yuin/goldmark-meta v1.1.0 // indirect + github.com/zclconf/go-cty v1.14.4 // indirect + go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect + golang.org/x/crypto v0.21.0 // indirect golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect - golang.org/x/mod v0.11.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/mod v0.16.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index 27da1893..123f5e61 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,49 +1,55 @@ +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0= +github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= -github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= -github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= -github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= -github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= -github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= +github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= +github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= -github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= -github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= -github.com/go-git/go-git/v5 v5.6.1/go.mod h1:mvyoL6Unz0PiTQrGQfSfiLFhBH1c1e84ylC2MDs4ee8= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= +github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/cli v1.1.6 h1:CMOV+/LJfL1tXCOKrgAX0uRKnzjj/mpmqNXloRSy2K8= +github.com/hashicorp/cli v1.1.6/go.mod h1:MPon5QYlgjjo0BSoAiN0ESeT5fRzDjVRp+uioJ0piz4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -60,20 +66,19 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.5.2 h1:SfwMFnEXVVirpwkDuSF5kymUOhrUxrTq3udEseZdOD0= -github.com/hashicorp/hc-install v0.5.2/go.mod h1:9QISwe6newMWIfEiXpzuu1k9HAGtQYgnSH8H9T8wmoI= -github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX5H8XZxHlH4= -github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980= -github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= -github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= -github.com/hashicorp/terraform-plugin-docs v0.16.0 h1:UmxFr3AScl6Wged84jndJIfFccGyBZn52KtMNsS12dI= -github.com/hashicorp/terraform-plugin-docs v0.16.0/go.mod h1:M3ZrlKBJAbPMtNOPwHicGi1c+hZUh7/g0ifT/z7TVfA= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/hashicorp/hc-install v0.6.4 h1:QLqlM56/+SIIGvGcfFiwMY3z5WGXT066suo/v9Km8e0= +github.com/hashicorp/hc-install v0.6.4/go.mod h1:05LWLy8TD842OtgcfBbOT0WMoInBMUSHjmDx10zuBIA= +github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= +github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= +github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= +github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= +github.com/hashicorp/terraform-plugin-docs v0.19.2 h1:YjdKa1vuqt9EnPYkkrv9HnGZz175HhSJ7Vsn8yZeWus= +github.com/hashicorp/terraform-plugin-docs v0.19.2/go.mod h1:gad2aP6uObFKhgNE8DR9nsEuEQnibp7il0jZYYOunWY= +github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= @@ -82,17 +87,13 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= -github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -103,20 +104,17 @@ github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= -github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= -github.com/skeema/knownhosts v1.1.0/go.mod h1:sKFq3RD6/TKZkSWn8boUbDC7Qkgcv+8XXijpFO6roag= +github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= +github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= @@ -124,48 +122,68 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= -github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= +github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= +github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= +github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= +github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= +go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From c8054ad516c16b45d6feeb5dae18c4961029c104 Mon Sep 17 00:00:00 2001 From: Piotr Truszkowski Date: Mon, 20 May 2024 20:26:54 +0200 Subject: [PATCH 3/4] Terragrunt OpenTofu: reset terraform_version when changing tool (#552) * recompute terraform_version if tool is changed * reset version for terraform_workflow_tool too --- spacelift/internal/testhelpers/helpers.go | 11 ++ spacelift/resource_stack.go | 39 ++++++ spacelift/resource_stack_test.go | 145 ++++++++++++++++++++++ 3 files changed, 195 insertions(+) diff --git a/spacelift/internal/testhelpers/helpers.go b/spacelift/internal/testhelpers/helpers.go index fbcdf76c..6fc30148 100644 --- a/spacelift/internal/testhelpers/helpers.go +++ b/spacelift/internal/testhelpers/helpers.go @@ -179,6 +179,17 @@ func Equals(expected string) ValueCheck { } } +// NotEquals checks for inequality against the unexpected value. +func NotEquals(unexpected string) ValueCheck { + return func(actual string) error { + if actual != unexpected { + return nil + } + + return errors.Errorf("unexpectedly got %q", actual) + } +} + // IsEmpty checks that the expected value is empty. func IsEmpty() ValueCheck { return func(actual string) error { diff --git a/spacelift/resource_stack.go b/spacelift/resource_stack.go index a09a4461..20372a9c 100644 --- a/spacelift/resource_stack.go +++ b/spacelift/resource_stack.go @@ -973,6 +973,10 @@ func getVendorConfig(d *schema.ResourceData) *structs.VendorConfigInput { terragruntConfig.Tool = toOptionalString(tool) } + if shouldWeReComputeTerraformVersionForTerragrunt(d) { + terragruntConfig.TerraformVersion = nil + } + return &structs.VendorConfigInput{ TerragruntInput: &terragruntConfig, } @@ -986,6 +990,9 @@ func getVendorConfig(d *schema.ResourceData) *structs.VendorConfigInput { if terraformWorkflowTool, ok := d.GetOk("terraform_workflow_tool"); ok { terraformConfig.WorkflowTool = toOptionalString(terraformWorkflowTool) + if shouldWeReComputeTerraformVersionForTerraformWorkflowTool(d) { + terraformConfig.Version = nil + } } if terraformWorkspace, ok := d.GetOk("terraform_workspace"); ok { @@ -1007,6 +1014,38 @@ func getVendorConfig(d *schema.ResourceData) *structs.VendorConfigInput { return &structs.VendorConfigInput{Terraform: terraformConfig} } +func shouldWeReComputeTerraformVersionForTerragrunt(d *schema.ResourceData) bool { + // When tool is changed, we need to recompute terraform version + oldTool, newTool := d.GetChange("terragrunt.0.tool") + if oldTool.(string) != newTool.(string) { + // but only if version isn't provided manually in the config + inConf := d.GetRawConfig().AsValueMap()["terragrunt"].AsValueSlice()[0].AsValueMap() + if value, ok := inConf["terraform_version"]; ok { + if value.IsNull() || value.AsString() == "" { + return true + } + } + } + + return false +} + +func shouldWeReComputeTerraformVersionForTerraformWorkflowTool(d *schema.ResourceData) bool { + // When tool is changed, we need to recompute terraform version + oldTool, newTool := d.GetChange("terraform_workflow_tool") + if oldTool.(string) != newTool.(string) { + // but only if version isn't provided manually in the config + inConfig := d.GetRawConfig().AsValueMap() + if value, ok := inConfig["terraform_version"]; ok { + if value.IsNull() || value.AsString() == "" { + return true + } + } + } + + return false +} + func getStrings(d *schema.ResourceData, fieldName string) []graphql.String { values := []graphql.String{} if commands, ok := d.GetOk(fieldName); ok { diff --git a/spacelift/resource_stack_test.go b/spacelift/resource_stack_test.go index 98950515..1839f143 100644 --- a/spacelift/resource_stack_test.go +++ b/spacelift/resource_stack_test.go @@ -663,6 +663,114 @@ func TestStackResource(t *testing.T) { }) }) + t.Run("with GitHub and Terragrunt changing configuration scenarios", func(t *testing.T) { + name := "terragrunt-switch-testing-" + acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) + config := func(body string) string { + return ` + resource "spacelift_stack" "test" { + administrative = true + branch = "master" + name = "` + name + `" + project_root = "root" + repository = "demo" + runner_image = "custom_image:runner" + autodeploy = true + terragrunt { + ` + body + ` + } + } + ` + } + testSteps(t, []resource.TestStep{ + { + Config: config(` + tool = "TERRAFORM_FOSS" + `), + Check: Resource( + "spacelift_stack.test", + Attribute("terragrunt.0.tool", Equals("TERRAFORM_FOSS")), + Attribute("terragrunt.0.terraform_version", IsNotEmpty()), + ), + }, + { // Change to OPEN_TOFU + Config: config(` + tool = "OPEN_TOFU" + `), + Check: Resource( + "spacelift_stack.test", + Attribute("terragrunt.0.tool", Equals("OPEN_TOFU")), + Attribute("terragrunt.0.terraform_version", IsNotEmpty()), + ), + }, + { // Change to TERRAFORM with specific version + Config: config(` + tool = "TERRAFORM_FOSS" + terraform_version = "1.5.6" + `), + Check: Resource( + "spacelift_stack.test", + Attribute("terragrunt.0.tool", Equals("TERRAFORM_FOSS")), + Attribute("terragrunt.0.terraform_version", Equals("1.5.6")), + ), + }, + { // Change to OPEN_TOFU with specific version + Config: config(` + tool = "OPEN_TOFU" + terraform_version = "1.6.2" + `), + Check: Resource( + "spacelift_stack.test", + Attribute("terragrunt.0.tool", Equals("OPEN_TOFU")), + Attribute("terragrunt.0.terraform_version", Equals("1.6.2")), + ), + }, + { // Change to TERRAFORM without version specified + Config: config(` + tool = "TERRAFORM_FOSS" + `), + Check: Resource( + "spacelift_stack.test", + Attribute("terragrunt.0.tool", Equals("TERRAFORM_FOSS")), + Attribute("terragrunt.0.terraform_version", NotEquals("1.6.2")), + ), + }, + { // Change to OPEN_TODU with invalid version + Config: config(` + tool = "OPEN_TOFU" + terraform_version = "1.5.6" + `), + ExpectError: regexp.MustCompile(`could not update stack: stack has 1 error: terragrunt: no supported OpenTofu version ([^ ]* - [^ ]*) satisfies constraints "1.5.6"`), + }, + { // Change to TERRAFORM with invalid version + Config: config(` + tool = "TERRAFORM_FOSS" + terraform_version = "1.6.2" + `), + ExpectError: regexp.MustCompile(`could not update stack: stack has 1 error: terragrunt: no supported Terraform version ([^ ]* - [^ ]*) satisfies constraints "1.6.2"`), + }, + { // Change to MANUALLY PROVISIONED + Config: config(` + tool = "MANUALLY_PROVISIONED" + `), + Check: Resource( + "spacelift_stack.test", + Attribute("terragrunt.0.tool", Equals("MANUALLY_PROVISIONED")), + Attribute("terragrunt.0.terraform_version", IsEmpty()), + ), + }, + { // Back to OPEN_TOFU + Config: config(` + tool = "OPEN_TOFU" + `), + Check: Resource( + "spacelift_stack.test", + Attribute("terragrunt.0.tool", Equals("OPEN_TOFU")), + Attribute("terragrunt.0.terraform_version", IsNotEmpty()), + ), + }, + }) + }) + t.Run("with GitHub and no vendor-specific configuration", func(t *testing.T) { testSteps(t, []resource.TestStep{ { @@ -1380,6 +1488,43 @@ func TestStackResourceSpace(t *testing.T) { Attribute("terraform_workflow_tool", Equals("CUSTOM")), ), }, + // Check to change from TERRAFORM_FOSS to CUSTOM with a specific version + // Actually, we don't need to specify the version, but when we don't do it, it will be + // evaluated on the first run. So, it's simpler just to specify a version for that test case. + { + Config: fmt.Sprintf(` + resource "spacelift_stack" "terraform_workflow_tool_custom_with_run" { + branch = "master" + name = "Provider test stack workflow_tool with run %s" + project_root = "root" + repository = "demo" + terraform_workflow_tool = "TERRAFORM_FOSS" + terraform_version = "1.5.7" + autodeploy = true + } + `, randomID), + Check: Resource( + "spacelift_stack.terraform_workflow_tool_custom_with_run", + Attribute("terraform_workflow_tool", Equals("TERRAFORM_FOSS")), + ), + }, + { + Config: fmt.Sprintf(` + resource "spacelift_stack" "terraform_workflow_tool_custom_with_run" { + branch = "master" + name = "Provider test stack workflow_tool with run %s" + project_root = "root" + repository = "demo" + terraform_workflow_tool = "CUSTOM" + terraform_version = "" + autodeploy = true + } + `, randomID), + Check: Resource( + "spacelift_stack.terraform_workflow_tool_custom_with_run", + Attribute("terraform_workflow_tool", Equals("CUSTOM")), + ), + }, }) }) } From 1cfb83113492d6b3459eb48e30c0b7699fd3aa05 Mon Sep 17 00:00:00 2001 From: Piotr Truszkowski Date: Tue, 28 May 2024 15:54:31 +0200 Subject: [PATCH 4/4] feat: new resource `spacelift_gitlab_integration` (#557) * refactor: moved CustomVCSInput and CustomVCSUpdateInput to separate package vcs * refactor: moved GitLab schema field name constants to gitlab_integration.go * feat: implemented spacelift_gitlab_integration resource * test: added tests for spacelift_gitlab_integration resource * docs: added examples and docs for spacelift_gitlab_integration resource * chore: added .envrc for easier setup of environment variables from .env file * cicd: added SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_TOKEN and SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_TOKEN to GitHub test workflows * fix: fix typo in GraphQL query for GitLabIntegration and add ForceNew flag to isDefault field in schema in spacelift/resource_gitlab_integration.go * refactor: rename "webhookURL" field to "webhookUrl" in GitLabIntegration struct and remove "Token" field * refactor: changes to spacelift/resource_gitlab_integration.go * add CustomizeDiff function ensure space is set to root if the integration should be the default * make gitLabUserFacingHost required and removed code to derive it from gitLabAPIHost if not set * set default value for gitLabSpaceID to "root" * docs: updated docs for spacelift_gitlab_integration * tests: updated tests for spacelift_gitlab_integration * added .envrc into .gitignore * minor fixes: naming, messaging, verifying --------- Co-authored-by: Thomas Meckel --- .github/workflows/test-prod.yml | 4 +- .github/workflows/test.yml | 4 +- .gitignore | 1 + docs/resources/gitlab_integration.md | 62 +++++ .../spacelift_gitlab_integration/import.sh | 1 + .../spacelift_gitlab_integration/resource.tf | 15 ++ spacelift/config_test.go | 2 + spacelift/data_gitlab_integration.go | 59 ++--- spacelift/gitlab_integration.go | 16 ++ .../bitbucket_datacenter_integration.go | 19 -- .../internal/structs/gitlab_integration.go | 18 ++ spacelift/internal/structs/vcs/input.go | 12 + spacelift/internal/structs/vcs/update.go | 11 + spacelift/provider.go | 1 + ...source_bitbucket_datacenter_integration.go | 5 +- spacelift/resource_gitlab_integration.go | 223 ++++++++++++++++++ spacelift/resource_gitlab_integration_test.go | 195 +++++++++++++++ 17 files changed, 589 insertions(+), 59 deletions(-) create mode 100644 docs/resources/gitlab_integration.md create mode 100644 examples/resources/spacelift_gitlab_integration/import.sh create mode 100644 examples/resources/spacelift_gitlab_integration/resource.tf create mode 100644 spacelift/gitlab_integration.go create mode 100644 spacelift/internal/structs/gitlab_integration.go create mode 100644 spacelift/internal/structs/vcs/input.go create mode 100644 spacelift/internal/structs/vcs/update.go create mode 100644 spacelift/resource_gitlab_integration.go create mode 100644 spacelift/resource_gitlab_integration_test.go diff --git a/.github/workflows/test-prod.yml b/.github/workflows/test-prod.yml index 3a1e2b6d..da045a33 100644 --- a/.github/workflows/test-prod.yml +++ b/.github/workflows/test-prod.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + - name: Install Go uses: actions/setup-go@v5 with: { go-version-file: go.mod } @@ -83,12 +83,14 @@ jobs: SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_NAME: "GitLab Default" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_ID: "gitlab-default" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_APIHOST: "https://gitlab.com" + SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_TOKEN: ${{ secrets.COMMON_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_TOKEN }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_WEBHOOKSECRET: ${{ secrets.PROD_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_WEBHOOKSECRET }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_WEBHOOKURL: ${{ secrets.PROD_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_WEBHOOKURL }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_NAME: "GitLab Space Level" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_ID: "gitlab-space-level" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_SPACE: "tests-01HPE6H08F8HR8PJR78DPYR3TC" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_APIHOST: "https://gitlab.com" + SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_TOKEN: ${{ secrets.COMMON_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_TOKEN }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_WEBHOOKSECRET: ${{ secrets.PROD_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_WEBHOOKSECRET }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_WEBHOOKURL: ${{ secrets.PROD_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_WEBHOOKURL }} SPACELIFT_PROVIDER_TEST_SOURCECODE_AZUREDEVOPS_REPOSITORY_NAME: "spacelift-ci" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b90503b..aaf05b7b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + - name: Install Go uses: actions/setup-go@v5 with: { go-version-file: go.mod } @@ -85,12 +85,14 @@ jobs: SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_NAME: "GitLab Default" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_ID: "gitlab-default" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_APIHOST: "https://gitlab.com" + SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_TOKEN: ${{ secrets.COMMON_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_TOKEN }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_WEBHOOKSECRET: ${{ secrets.PREPROD_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_WEBHOOKSECRET }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_WEBHOOKURL: ${{ secrets.PREPROD_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_DEFAULT_WEBHOOKURL }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_NAME: "GitLab Space Level" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_ID: "gitlab-space-level" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_SPACE: "tests-01HPE6ENR1AZZ638QSRQRVW4DH" SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_APIHOST: "https://gitlab.com" + SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_TOKEN: ${{ secrets.COMMON_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_TOKEN }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_WEBHOOKSECRET: ${{ secrets.PREPROD_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_WEBHOOKSECRET }} SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_WEBHOOKURL: ${{ secrets.PREPROD_SPACELIFT_PROVIDER_TEST_SOURCECODE_GITLAB_SPACELEVEL_WEBHOOKURL }} SPACELIFT_PROVIDER_TEST_SOURCECODE_AZUREDEVOPS_REPOSITORY_NAME: "spacelift-ci" diff --git a/.gitignore b/.gitignore index 114c876f..c614ff05 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ key.* dist/ test.env +.envrc diff --git a/docs/resources/gitlab_integration.md b/docs/resources/gitlab_integration.md new file mode 100644 index 00000000..d6bd6063 --- /dev/null +++ b/docs/resources/gitlab_integration.md @@ -0,0 +1,62 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "spacelift_gitlab_integration Resource - terraform-provider-spacelift" +subcategory: "" +description: |- + spacelift_gitlab_integration represents an integration with a GitLab instance +--- + +# spacelift_gitlab_integration (Resource) + +`spacelift_gitlab_integration` represents an integration with a GitLab instance + +## Example Usage + +```terraform +resource "spacelift_gitlab_integration" "example" { + name = "GitLab integration (public)" + space_id = "root" + api_host = "https://mygitlab.myorg.com" + user_facing_host = "https://mygitlab.myorg.com" + private_token = "gitlab-token" +} + +resource "spacelift_gitlab_integration" "private-example" { + name = "GitLab integration (private)" + is_default = true + api_host = "private://mygitlab" + user_facing_host = "https://mygitlab.myorg.com" + private_token = "gitlab-token" +} +``` + + +## Schema + +### Required + +- `api_host` (String) API host URL +- `name` (String) The friendly name of the integration +- `private_token` (String, Sensitive) The GitLab API Token +- `user_facing_host` (String) User facing host URL. + +### Optional + +- `description` (String) Description of the integration +- `is_default` (Boolean) Is the GitLab integration the default for all spaces? If set to `true` the space must be set to `root` in `space_id` or left empty which uses the default +- `labels` (Set of String) Labels to set on the integration +- `space_id` (String) ID (slug) of the space the integration is in; Default: `root` + +### Read-Only + +- `id` (String) GitLab integration id. +- `webhook_secret` (String, Sensitive) Secret for webhooks originating from GitLab repositories +- `webhook_url` (String) URL for webhooks originating from GitLab repositories + +## Import + +Import is supported using the following syntax: + +```shell +terraform import spacelift_gitlab_integration.example spacelift_gitlab_integration_id +``` diff --git a/examples/resources/spacelift_gitlab_integration/import.sh b/examples/resources/spacelift_gitlab_integration/import.sh new file mode 100644 index 00000000..c46c6070 --- /dev/null +++ b/examples/resources/spacelift_gitlab_integration/import.sh @@ -0,0 +1 @@ +terraform import spacelift_gitlab_integration.example spacelift_gitlab_integration_id diff --git a/examples/resources/spacelift_gitlab_integration/resource.tf b/examples/resources/spacelift_gitlab_integration/resource.tf new file mode 100644 index 00000000..709d2791 --- /dev/null +++ b/examples/resources/spacelift_gitlab_integration/resource.tf @@ -0,0 +1,15 @@ +resource "spacelift_gitlab_integration" "example" { + name = "GitLab integration (public)" + space_id = "root" + api_host = "https://mygitlab.myorg.com" + user_facing_host = "https://mygitlab.myorg.com" + private_token = "gitlab-token" +} + +resource "spacelift_gitlab_integration" "private-example" { + name = "GitLab integration (private)" + is_default = true + api_host = "private://mygitlab" + user_facing_host = "https://mygitlab.myorg.com" + private_token = "gitlab-token" +} diff --git a/spacelift/config_test.go b/spacelift/config_test.go index 515f02f7..a1f49e3d 100644 --- a/spacelift/config_test.go +++ b/spacelift/config_test.go @@ -108,6 +108,7 @@ var testConfig struct { Default struct { Name string ID string + Token string APIHost string WebhookSecret string WebhookURL string @@ -117,6 +118,7 @@ var testConfig struct { ID string Space string APIHost string + Token string WebhookSecret string WebhookURL string } diff --git a/spacelift/data_gitlab_integration.go b/spacelift/data_gitlab_integration.go index 689bf52b..0a99dcec 100644 --- a/spacelift/data_gitlab_integration.go +++ b/spacelift/data_gitlab_integration.go @@ -9,19 +9,6 @@ import ( "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal" ) -const ( - gitlabId = "id" - gitlabName = "name" - gitlabDescription = "description" - gitlabIsDefault = "is_default" - gitlabLabels = "labels" - gitlabSpaceID = "space_id" - gitlabAppID = "app_id" - gitlabAPIHost = "api_host" - gitlabWebhookSecret = "webhook_secret" - gitlabWebhookURL = "webhook_url" -) - func dataGitlabIntegration() *schema.Resource { return &schema.Resource{ Description: "`spacelift_gitlab_integration` returns details about Gitlab integration", @@ -29,27 +16,27 @@ func dataGitlabIntegration() *schema.Resource { ReadContext: dataGitlabIntegrationRead, Schema: map[string]*schema.Schema{ - gitlabId: { + gitLabID: { Type: schema.TypeString, Description: "Gitlab integration id. If not provided, the default integration will be returned", Optional: true, }, - gitlabName: { + gitLabName: { Type: schema.TypeString, Description: "Gitlab integration name", Computed: true, }, - gitlabDescription: { + gitLabDescription: { Type: schema.TypeString, Description: "Gitlab integration description", Computed: true, }, - gitlabIsDefault: { + gitLabIsDefault: { Type: schema.TypeBool, Description: "Gitlab integration is default", Computed: true, }, - gitlabLabels: { + gitLabLabels: { Type: schema.TypeList, Description: "Gitlab integration labels", Computed: true, @@ -57,22 +44,22 @@ func dataGitlabIntegration() *schema.Resource { Type: schema.TypeString, }, }, - gitlabSpaceID: { + gitLabSpaceID: { Type: schema.TypeString, Description: "Gitlab integration space id", Computed: true, }, - gitlabAPIHost: { + gitLabAPIHost: { Type: schema.TypeString, Description: "Gitlab integration api host", Computed: true, }, - gitlabWebhookSecret: { + gitLabWebhookSecret: { Type: schema.TypeString, Description: "Gitlab integration webhook secret", Computed: true, }, - gitlabWebhookURL: { + gitLabWebhookURL: { Type: schema.TypeString, Description: "Gitlab integration webhook url", Computed: true, @@ -101,7 +88,7 @@ func dataGitlabIntegrationRead(ctx context.Context, d *schema.ResourceData, meta variables := map[string]interface{}{"id": ""} - if id, ok := d.GetOk(gitlabId); ok && id != "" { + if id, ok := d.GetOk(gitLabID); ok && id != "" { variables["id"] = toID(id) } @@ -109,27 +96,27 @@ func dataGitlabIntegrationRead(ctx context.Context, d *schema.ResourceData, meta return diag.Errorf("could not query for gitlab integration: %v", err) } - gitlabIntegration := query.GitlabIntegration - if gitlabIntegration == nil { + gitLabIntegration := query.GitlabIntegration + if gitLabIntegration == nil { return diag.Errorf("gitlab integration not found") } - d.SetId(gitlabIntegration.ID) - d.Set(gitlabAPIHost, gitlabIntegration.APIHost) - d.Set(gitlabWebhookSecret, gitlabIntegration.WebhookSecret) - d.Set(gitlabWebhookURL, gitlabIntegration.WebhookURL) - d.Set(gitlabId, gitlabIntegration.ID) - d.Set(gitlabName, gitlabIntegration.Name) - d.Set(gitlabDescription, gitlabIntegration.Description) - d.Set(gitlabIsDefault, gitlabIntegration.IsDefault) - d.Set(gitlabSpaceID, gitlabIntegration.Space.ID) + d.SetId(gitLabIntegration.ID) + d.Set(gitLabAPIHost, gitLabIntegration.APIHost) + d.Set(gitLabWebhookSecret, gitLabIntegration.WebhookSecret) + d.Set(gitLabWebhookURL, gitLabIntegration.WebhookURL) + d.Set(gitLabID, gitLabIntegration.ID) + d.Set(gitLabName, gitLabIntegration.Name) + d.Set(gitLabDescription, gitLabIntegration.Description) + d.Set(gitLabIsDefault, gitLabIntegration.IsDefault) + d.Set(gitLabSpaceID, gitLabIntegration.Space.ID) labels := schema.NewSet(schema.HashString, []interface{}{}) - for _, label := range gitlabIntegration.Labels { + for _, label := range gitLabIntegration.Labels { labels.Add(label) } - d.Set(gitlabLabels, labels) + d.Set(gitLabLabels, labels) return nil } diff --git a/spacelift/gitlab_integration.go b/spacelift/gitlab_integration.go new file mode 100644 index 00000000..cfcd5637 --- /dev/null +++ b/spacelift/gitlab_integration.go @@ -0,0 +1,16 @@ +package spacelift + +const ( + gitLabID = "id" + gitLabName = "name" + gitLabDescription = "description" + gitLabIsDefault = "is_default" + gitLabLabels = "labels" + gitLabSpaceID = "space_id" + gitLabUserFacingHost = "user_facing_host" + gitLabAppID = "app_id" + gitLabAPIHost = "api_host" + gitLabToken = "private_token" + gitLabWebhookURL = "webhook_url" + gitLabWebhookSecret = "webhook_secret" +) diff --git a/spacelift/internal/structs/bitbucket_datacenter_integration.go b/spacelift/internal/structs/bitbucket_datacenter_integration.go index ff5c3559..deea1601 100644 --- a/spacelift/internal/structs/bitbucket_datacenter_integration.go +++ b/spacelift/internal/structs/bitbucket_datacenter_integration.go @@ -1,7 +1,5 @@ package structs -import "github.com/shurcooL/graphql" - // BitbucketDatacenterIntegration represents the bitbucket datacenter integration data relevant to the provider. type BitbucketDatacenterIntegration struct { ID string `graphql:"id"` @@ -18,20 +16,3 @@ type BitbucketDatacenterIntegration struct { WebhookSecret string `graphql:"webhookSecret"` WebhookURL string `graphql:"webhookURL"` } - -// CustomVCSInput represents the custom VCS input data. -type CustomVCSInput struct { - Name graphql.String `json:"name"` - SpaceID graphql.ID `json:"spaceID"` - Labels *[]graphql.String `json:"labels"` - Description *graphql.String `json:"description"` - IsDefault *graphql.Boolean `json:"isDefault"` -} - -// CustomVCSUpdateInput represents the custom VCS update input data. -type CustomVCSUpdateInput struct { - ID graphql.ID `json:"id"` - SpaceID graphql.ID `json:"space"` - Labels *[]graphql.String `json:"labels"` - Description *graphql.String `json:"description"` -} diff --git a/spacelift/internal/structs/gitlab_integration.go b/spacelift/internal/structs/gitlab_integration.go new file mode 100644 index 00000000..f74f72e1 --- /dev/null +++ b/spacelift/internal/structs/gitlab_integration.go @@ -0,0 +1,18 @@ +package structs + +// GitLabIntegration represents an GitLab identity provided by the Spacelift +// integration. +type GitLabIntegration struct { + ID string `graphql:"id"` + Name string `graphql:"name"` + Space struct { + ID string `graphql:"id"` + } `graphql:"space"` + IsDefault bool `graphql:"isDefault"` + Labels []string `graphql:"labels"` + Description *string `graphql:"description"` + APIHost string `graphql:"apiHost"` + UserFacingHost string `graphql:"userFacingHost"` + WebhookSecret string `graphql:"webhookSecret"` + WebhookURL string `graphql:"webhookUrl"` +} diff --git a/spacelift/internal/structs/vcs/input.go b/spacelift/internal/structs/vcs/input.go new file mode 100644 index 00000000..55dc52dc --- /dev/null +++ b/spacelift/internal/structs/vcs/input.go @@ -0,0 +1,12 @@ +package vcs + +import "github.com/shurcooL/graphql" + +// CustomVCSInput represents the custom VCS input data. +type CustomVCSInput struct { + Name graphql.String `json:"name"` + SpaceID graphql.ID `json:"spaceID"` + Labels *[]graphql.String `json:"labels"` + Description *graphql.String `json:"description"` + IsDefault *graphql.Boolean `json:"isDefault"` +} diff --git a/spacelift/internal/structs/vcs/update.go b/spacelift/internal/structs/vcs/update.go new file mode 100644 index 00000000..fb7ecf03 --- /dev/null +++ b/spacelift/internal/structs/vcs/update.go @@ -0,0 +1,11 @@ +package vcs + +import "github.com/shurcooL/graphql" + +// CustomVCSUpdateInput represents the custom VCS update input data. +type CustomVCSUpdateInput struct { + ID graphql.ID `json:"id"` + SpaceID graphql.ID `json:"space"` + Labels *[]graphql.String `json:"labels"` + Description *graphql.String `json:"description"` +} diff --git a/spacelift/provider.go b/spacelift/provider.go index 8f840e44..f67a3544 100644 --- a/spacelift/provider.go +++ b/spacelift/provider.go @@ -113,6 +113,7 @@ func Provider(commit, version string) plugin.ProviderFunc { "spacelift_drift_detection": resourceDriftDetection(), "spacelift_environment_variable": resourceEnvironmentVariable(), "spacelift_gcp_service_account": resourceGCPServiceAccount(), + "spacelift_gitlab_integration": resourceGitLabIntegration(), "spacelift_idp_group_mapping": resourceIdpGroupMapping(), "spacelift_module": resourceModule(), "spacelift_mounted_file": resourceMountedFile(), diff --git a/spacelift/resource_bitbucket_datacenter_integration.go b/spacelift/resource_bitbucket_datacenter_integration.go index 5521e9d7..ca862f9b 100644 --- a/spacelift/resource_bitbucket_datacenter_integration.go +++ b/spacelift/resource_bitbucket_datacenter_integration.go @@ -8,6 +8,7 @@ import ( "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal" "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal/structs" + "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal/structs/vcs" "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal/validations" ) @@ -107,7 +108,7 @@ func resourceBitbucketDatacenterIntegrationCreate(ctx context.Context, d *schema } variables := map[string]interface{}{ - "customInput": &structs.CustomVCSInput{ + "customInput": &vcs.CustomVCSInput{ Name: toString(d.Get(bitbucketDatacenterName)), IsDefault: toOptionalBool(d.Get(bitbucketDatacenterIsDefault)), SpaceID: toString(d.Get(bitbucketDatacenterSpaceID)), @@ -158,7 +159,7 @@ func resourceBitbucketDatacenterIntegrationUpdate(ctx context.Context, d *schema "userFacingHost": toString(d.Get(bitbucketDatacenterUserFacingHost)), "username": toOptionalString(d.Get(bitbucketDatacenterUsername)), "accessToken": toOptionalString(d.Get(bitbucketDatacenterAccessToken)), - "customInput": &structs.CustomVCSUpdateInput{ + "customInput": &vcs.CustomVCSUpdateInput{ ID: toID(d.Id()), SpaceID: toString(d.Get(bitbucketDatacenterSpaceID)), Description: toOptionalString(d.Get(bitbucketDatacenterDescription)), diff --git a/spacelift/resource_gitlab_integration.go b/spacelift/resource_gitlab_integration.go new file mode 100644 index 00000000..6339b46a --- /dev/null +++ b/spacelift/resource_gitlab_integration.go @@ -0,0 +1,223 @@ +package spacelift + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal" + "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal/structs" + "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal/structs/vcs" + "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal/validations" +) + +func resourceGitLabIntegration() *schema.Resource { + return &schema.Resource{ + Description: "`spacelift_gitlab_integration` represents an integration with a GitLab instance", + CreateContext: resourceGitLabIntegrationCreate, + ReadContext: resourceGitLabIntegrationRead, + UpdateContext: resourceGitLabIntegrationUpdate, + DeleteContext: resourceGitLabIntegrationDelete, + + CustomizeDiff: func(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) error { + if diff.HasChange(gitLabIsDefault) { + isDefault := diff.Get(gitLabIsDefault).(bool) + spaceID := diff.Get(gitLabSpaceID).(string) + if isDefault && spaceID != "root" { + return fmt.Errorf(`The default integration must be in the space "root" not in %q`, spaceID) + } + } + return nil + }, + + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + gitLabID: { + Type: schema.TypeString, + Description: "GitLab integration id.", + Computed: true, + }, + gitLabName: { + Type: schema.TypeString, + Description: "The friendly name of the integration", + Required: true, + ForceNew: true, + ValidateDiagFunc: validations.DisallowEmptyString, + }, + gitLabDescription: { + Type: schema.TypeString, + Description: "Description of the integration", + Optional: true, + ValidateDiagFunc: validations.DisallowEmptyString, + }, + gitLabAPIHost: { + Type: schema.TypeString, + Required: true, + Description: "API host URL", + ValidateDiagFunc: validations.DisallowEmptyString, + }, + gitLabUserFacingHost: { + Type: schema.TypeString, + Required: true, + Description: "User facing host URL.", + ValidateDiagFunc: validations.DisallowEmptyString, + }, + gitLabToken: { + Type: schema.TypeString, + Description: "The GitLab API Token", + Required: true, + Sensitive: true, + ValidateDiagFunc: validations.DisallowEmptyString, + }, + gitLabLabels: { + Type: schema.TypeSet, + Description: "Labels to set on the integration", + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateDiagFunc: validations.DisallowEmptyString, + }, + Optional: true, + }, + gitLabSpaceID: { + Type: schema.TypeString, + Description: "ID (slug) of the space the integration is in; Default: `root`", + Optional: true, + Default: "root", + ValidateDiagFunc: validations.DisallowEmptyString, + }, + gitLabIsDefault: { + Type: schema.TypeBool, + Description: "Is the GitLab integration the default for all spaces? If set to `true` the space must be set to `root` in `" + gitLabSpaceID + "` or left empty which uses the default", + Optional: true, + Default: false, + ForceNew: true, // unable to update isDefault flag + }, + gitLabWebhookSecret: { + Type: schema.TypeString, + Description: "Secret for webhooks originating from GitLab repositories", + Computed: true, + Sensitive: true, + }, + gitLabWebhookURL: { + Type: schema.TypeString, + Description: "URL for webhooks originating from GitLab repositories", + Computed: true, + }, + }, + } +} + +func resourceGitLabIntegrationCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var mutation struct { + CreateGitLabIntegration structs.GitLabIntegration `graphql:"gitlabIntegrationCreate(apiHost: $apiHost, userFacingHost: $userFacingHost, privateToken: $token, customInput: $customInput)"` + } + + variables := map[string]interface{}{ + "customInput": &vcs.CustomVCSInput{ + Name: toString(d.Get(gitLabName)), + IsDefault: toOptionalBool(d.Get(gitLabIsDefault)), + SpaceID: toString(d.Get(gitLabSpaceID)), + Labels: toOptionalStringList(d.Get(gitLabLabels)), + Description: toOptionalString(d.Get(gitLabDescription)), + }, + "apiHost": toString(d.Get(gitLabAPIHost)), + "userFacingHost": toString(d.Get(gitLabUserFacingHost)), + "token": toString(d.Get(gitLabToken)), + } + + if err := meta.(*internal.Client).Mutate(ctx, "GitLabIntegrationCreate", &mutation, variables); err != nil { + return diag.Errorf("could not create the GitLab integration: %v", internal.FromSpaceliftError(err)) + } + + fillGitLabIntegrationResults(d, &mutation.CreateGitLabIntegration) + + return nil +} + +func resourceGitLabIntegrationRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var query struct { + GitLabIntegration *structs.GitLabIntegration `graphql:"gitlabIntegration(id: $id)"` + } + + variables := map[string]interface{}{"id": d.Id()} + if err := meta.(*internal.Client).Query(ctx, "GitLabIntegrationRead", &query, variables); err != nil { + return diag.Errorf("could not query for the gitlab integration: %v", err) + } + + if query.GitLabIntegration == nil { + d.SetId("") + } else { + fillGitLabIntegrationResults(d, query.GitLabIntegration) + } + + return nil +} + +func resourceGitLabIntegrationUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var mutation struct { + UpdateGitLabIntegration structs.GitLabIntegration `graphql:"gitlabIntegrationUpdate(apiHost: $apiHost, userFacingHost: $userFacingHost, privateToken: $privateToken, customInput: $customInput)"` + } + + variables := map[string]interface{}{ + "privateToken": toOptionalString(d.Get(gitLabToken)), + "apiHost": toString(d.Get(gitLabAPIHost)), + "userFacingHost": toString(d.Get(gitLabUserFacingHost)), + "customInput": &vcs.CustomVCSUpdateInput{ + ID: toID(d.Id()), + SpaceID: toString(d.Get(gitLabSpaceID)), + Description: toOptionalString(d.Get(gitLabDescription)), + Labels: toOptionalStringList(d.Get(gitLabLabels)), + }, + } + + var ret diag.Diagnostics + + if err := meta.(*internal.Client).Mutate(ctx, "GitLabIntegrationUpdate", &mutation, variables); err != nil { + ret = append(ret, diag.Errorf("could not update the GitLab integration: %v", internal.FromSpaceliftError(err))...) + } + + fillGitLabIntegrationResults(d, &mutation.UpdateGitLabIntegration) + + return ret +} + +func resourceGitLabIntegrationDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var mutation struct { + DeleteGitLabIntegration *structs.GitLabIntegration `graphql:"gitlabIntegrationDelete(id: $id)"` + } + + variables := map[string]interface{}{ + "id": toID(d.Id()), + } + + if err := meta.(*internal.Client).Mutate(ctx, "GitLabIntegrationDelete", &mutation, variables); err != nil { + return diag.Errorf("could not delete GitLab integration: %v", internal.FromSpaceliftError(err)) + } + + d.SetId("") + + return nil +} + +func fillGitLabIntegrationResults(d *schema.ResourceData, gitLabIntegration *structs.GitLabIntegration) { + d.SetId(gitLabIntegration.ID) + d.Set(gitLabName, gitLabIntegration.Name) + d.Set(gitLabSpaceID, gitLabIntegration.Space.ID) + d.Set(gitLabIsDefault, gitLabIntegration.IsDefault) + d.Set(gitLabDescription, gitLabIntegration.Description) + d.Set(gitLabAPIHost, gitLabIntegration.APIHost) + d.Set(gitLabUserFacingHost, gitLabIntegration.UserFacingHost) + d.Set(gitLabWebhookURL, gitLabIntegration.WebhookURL) + d.Set(gitLabWebhookSecret, gitLabIntegration.WebhookSecret) + + labels := schema.NewSet(schema.HashString, []interface{}{}) + for _, label := range gitLabIntegration.Labels { + labels.Add(label) + } + d.Set(gitLabLabels, labels) +} diff --git a/spacelift/resource_gitlab_integration_test.go b/spacelift/resource_gitlab_integration_test.go new file mode 100644 index 00000000..eb09a37f --- /dev/null +++ b/spacelift/resource_gitlab_integration_test.go @@ -0,0 +1,195 @@ +package spacelift + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + . "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal/testhelpers" +) + +func TestGitLabIntegrationResource(t *testing.T) { + const resourceName = "spacelift_gitlab_integration.test" + + t.Run("creates and updates a GitLab integration without an error", func(t *testing.T) { + random := func() string { return acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) } + + var ( + name = "my-test-gitlab-integration-" + random() + host = "https://gitlab.com/" + random() + token = "access-" + random() + descr = "description " + random() + labels = `["label1", "label2"]` + ) + + configGitLab := func(host, token, descr, labels string) string { + return ` + resource "spacelift_gitlab_integration" "test" { + name = "` + name + `" + api_host = "` + host + `" + user_facing_host = "` + host + `" + private_token = "` + token + `" + description = "` + descr + `" + labels = ` + labels + ` + } + ` + } + + configStack := func() string { + return ` + resource "spacelift_worker_pool" "test" { + name = "Let's create a dummy worker pool to avoid running the job ` + name + `" + space_id = "` + testConfig.SourceCode.Gitlab.SpaceLevel.Space + `" + } + + resource "spacelift_stack" "test" { + name = "stack-for-` + name + `" + repository = "` + testConfig.SourceCode.Gitlab.Repository.Name + `" + branch = "` + testConfig.SourceCode.Gitlab.Repository.Branch + `" + space_id = "` + testConfig.SourceCode.Gitlab.SpaceLevel.Space + `" + administrative = false + worker_pool_id = spacelift_worker_pool.test.id + gitlab { + namespace = "` + testConfig.SourceCode.Gitlab.Repository.Namespace + `" + id = spacelift_gitlab_integration.test.id + } + } + ` + } + + configRun := func() string { + return ` + resource "spacelift_run" "test" { + stack_id = spacelift_stack.test.id + keepers = { "branch" = "` + testConfig.SourceCode.Gitlab.Repository.Branch + `" } + } + ` + } + + spaceLevel := testConfig.SourceCode.Gitlab.SpaceLevel + + testSteps(t, []resource.TestStep{ + { + Config: configGitLab(host, token, descr, "null"), + Check: Resource( + resourceName, + Attribute(gitLabName, Equals(name)), + Attribute(gitLabAPIHost, Equals(host)), + Attribute(gitLabUserFacingHost, Equals(host)), + Attribute(gitLabToken, Equals(token)), + Attribute(gitLabWebhookURL, IsNotEmpty()), + Attribute(gitLabWebhookSecret, IsNotEmpty()), + Attribute(gitLabIsDefault, Equals("false")), + Attribute(gitLabDescription, Equals(descr)), + AttributeNotPresent(gitLabLabels), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{gitLabToken}, // specified only in the config + }, + { + Config: configGitLab(host, token, "new descr", `["new label1"]`), + Check: Resource( + resourceName, + Attribute(gitLabAPIHost, Equals(host)), + Attribute(gitLabUserFacingHost, Equals(host)), + Attribute(gitLabIsDefault, Equals("false")), + Attribute(gitLabDescription, Equals("new descr")), + Attribute(gitLabLabels+".#", Equals("1")), + Attribute(gitLabLabels+".0", Equals("new label1")), + ), + }, + { + Config: configGitLab(spaceLevel.APIHost, spaceLevel.Token, descr, labels), + Check: Resource( + resourceName, + Attribute(gitLabAPIHost, Equals(spaceLevel.APIHost)), + Attribute(gitLabUserFacingHost, Equals(spaceLevel.APIHost)), + Attribute(gitLabIsDefault, Equals("false")), + Attribute(gitLabToken, Equals(spaceLevel.Token)), + Attribute(gitLabDescription, Equals(descr)), + Attribute(gitLabLabels+".#", Equals("2")), + Attribute(gitLabLabels+".0", Equals("label1")), + Attribute(gitLabLabels+".1", Equals("label2")), + ), + }, + { + Config: configGitLab(spaceLevel.APIHost, spaceLevel.Token, descr, labels) + configStack(), + Check: Resource( + "spacelift_stack.test", + Attribute("gitlab.0.id", Equals(name)), + ), + }, + { + Config: configGitLab(spaceLevel.APIHost, spaceLevel.Token, descr, labels) + configStack() + configRun(), + Check: Resource( + "spacelift_run.test", + Attribute(gitLabID, IsNotEmpty()), + Attribute("stack_id", Equals("stack-for-"+name)), + ), + }, + }) + }) +} + +func TestGitLabIntegrationClearLabels(t *testing.T) { + const resourceName = "spacelift_gitlab_integration.test" + + t.Run("creates and updates a GitLab integration without an error", func(t *testing.T) { + random := func() string { return acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) } + + var ( + name = "my-test-gitlab-integration-" + random() + host = "https://gitlab.com/" + random() + token = "access-" + random() + descr = "description " + random() + ) + + configGitLab := func(host, token, descr, labels string) string { + return ` + resource "spacelift_gitlab_integration" "test" { + name = "` + name + `" + api_host = "` + host + `" + user_facing_host = "` + host + `" + private_token = "` + token + `" + description = "` + descr + `" + labels = ` + labels + ` + } + ` + } + testSteps(t, []resource.TestStep{ + { + Config: configGitLab(host, token, descr, "null"), + Check: Resource( + resourceName, + AttributeNotPresent(gitLabLabels), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{gitLabToken}, // specified only in the config + }, + { + Config: configGitLab(host, token, "new descr", `["new label1"]`), + Check: Resource( + resourceName, + Attribute(gitLabLabels+".#", Equals("1")), + Attribute(gitLabLabels+".0", Equals("new label1")), + ), + }, + { + Config: configGitLab(host, host, descr, "null"), + Check: Resource( + resourceName, + AttributeNotPresent(gitLabLabels), + ), + }, + }) + }) +}