Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/add-support-f…
Browse files Browse the repository at this point in the history
…or-exit-networks
  • Loading branch information
vmanilo committed Nov 24, 2024
2 parents f9fff5a + 98287a2 commit 3147bd1
Show file tree
Hide file tree
Showing 41 changed files with 1,928 additions and 2,060 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ updates:
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/tools"
schedule:
interval: "daily"
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,13 @@ jobs:
needs: build
runs-on: ubuntu-latest
if: "!github.event.pull_request.head.repo.fork"
timeout-minutes: 15
strategy:
max-parallel: 2
max-parallel: 3
fail-fast: false
matrix:
terraform:
- '1.8.*'
- '1.9.*'
# - '1.9.*'
- 'latest'
steps:

Expand Down Expand Up @@ -161,6 +160,7 @@ jobs:
TWINGATE_API_TOKEN: ${{ secrets.TWINGATE_API_TOKEN }}
TEST_UNIQUE_VALUE: ${{ github.run_id }}-${{ github.run_number }}-${{ matrix.terraform }}
run: |
terraform version
make testacc
- name: Send coverage
Expand All @@ -175,13 +175,13 @@ jobs:
needs: build
runs-on: ubuntu-latest
if: "!github.event.pull_request.head.repo.fork"
timeout-minutes: 15
strategy:
max-parallel: 2
max-parallel: 3
fail-fast: false
matrix:
tofu:
- '1.6.*'
- '1.7.*'
- 'latest'

steps:
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:
cleanup:
name: Cleanup
if: "!github.event.pull_request.head.repo.fork"
if: '!github.event.pull_request.head.repo.fork && always()'
needs: [tests-acceptance, tests-acceptance-opentofu]
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/smoketests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
name: Smoke Tests
permissions: read-all
on:
schedule:
- cron: "0 */3 * * *"
# schedule:
# - cron: "0 */3 * * *"
workflow_dispatch: {}

jobs:
Expand Down Expand Up @@ -40,14 +40,13 @@ jobs:
name: Matrix Acceptance Tests
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
max-parallel: 2
max-parallel: 3
fail-fast: false
matrix:
terraform:
- '1.8.*'
- '1.9.*'
# - '1.9.*'
- 'latest'
steps:
- name: Check out code into the Go module directory
Expand Down Expand Up @@ -94,6 +93,7 @@ jobs:
TWINGATE_API_TOKEN: ${{ secrets.TWINGATE_API_TOKEN }}
TEST_UNIQUE_VALUE: ${{ github.run_id }}-${{ github.run_number }}-${{ matrix.terraform }}
run: |
terraform version
make testacc
- name: Report Status
Expand All @@ -112,14 +112,13 @@ jobs:
name: OpenTofu Matrix Acceptance Tests
needs: build
runs-on: ubuntu-latest
if: "!github.event.pull_request.head.repo.fork"
timeout-minutes: 15
strategy:
max-parallel: 2
max-parallel: 3
fail-fast: false
matrix:
tofu:
- '1.6.*'
- '1.7.*'
- 'latest'

steps:
Expand Down Expand Up @@ -162,7 +161,7 @@ jobs:
cleanup:
name: Cleanup
if: always()
if: '!github.event.pull_request.head.repo.fork && always()'
needs: [tests-acceptance, tests-acceptance-opentofu]
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.22
1.23
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
golang 1.22.0
golang 1.23.2
python 3.12.2
terraform 1.9.2
25 changes: 11 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ OS_ARCH=darwin_amd64
GOBINPATH=$(shell go env GOPATH)/bin
SWEEP_TENANT=terraformtests
SWEEP_FOLDER=./twingate/internal/test/sweepers
GOLINT_VERSION=v1.61.0
GOSEC_VERSION=2.21.4


check_defined = \
Expand Down Expand Up @@ -68,26 +70,21 @@ fmtcheck:
@sh -c $(CURDIR)/scripts/gofmtcheck.sh

.PHONY: lint
lint: tools
lint:
@echo "==> Checking source code against linters..."
@$(GOBINPATH)/golangci-lint run -c golangci.yml ./$(PKG_NAME)/...
docker run -t --rm -v $(PWD):/app -w /app golangci/golangci-lint:$(GOLINT_VERSION) golangci-lint run -c /app/golangci.yml ./$(PKG_NAME)/...


.PHONY: lint-fix
lint-fix: tools
lint-fix:
@echo "==> Checking source code against linters with fix enabled..."
@$(GOBINPATH)/golangci-lint run --fix -c golangci.yml ./$(PKG_NAME)/...
docker run -t --rm -v $(PWD):/app -w /app golangci/golangci-lint:$(GOLINT_VERSION) golangci-lint run --fix -c /app/golangci.yml ./$(PKG_NAME)/...

.PHONY: sec
sec: tools
sec:
@echo "==> Checking source code against security issues..."
go run github.com/securego/gosec/v2/cmd/gosec ./$(PKG_NAME)/...

docker run -t --rm -e GOFLAGS=-buildvcs=false -v $(PWD):/app -w /app securego/gosec:$(GOSEC_VERSION) gosec ./$(PKG_NAME)/...

.PHONY: doc-tools
docs: doc-tools
.PHONY: docs
docs:
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate

.PHONY: tools
tools:
@echo "==> installing required tools ..."
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
## Requirements

- Bash
- [Go](https://golang.org/doc/install) 1.22 (to build the provider plugin)
- [Go](https://golang.org/doc/install) 1.23 (to build the provider plugin)
- [Terraform](https://www.terraform.io/downloads.html) 1.x

## Build
Expand Down
81 changes: 25 additions & 56 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
module github.com/Twingate/terraform-provider-twingate/v3

go 1.22.0

toolchain go1.22.5
go 1.23

require (
github.com/client9/misspell v0.3.4
github.com/google/go-cmp v0.6.0
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/terraform-plugin-docs v0.19.4
github.com/hashicorp/terraform-plugin-framework v1.12.0
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
github.com/hashicorp/terraform-plugin-go v0.24.0
github.com/hashicorp/terraform-plugin-testing v1.10.0
github.com/hashicorp/terraform-plugin-docs v0.20.0
github.com/hashicorp/terraform-plugin-framework v1.13.0
github.com/hashicorp/terraform-plugin-framework-validators v0.15.0
github.com/hashicorp/terraform-plugin-go v0.25.0
github.com/hashicorp/terraform-plugin-testing v1.11.0
github.com/hasura/go-graphql-client v0.13.1
github.com/iancoleman/strcase v0.3.0
github.com/jarcoal/httpmock v1.3.1
github.com/mattn/goveralls v0.0.12
github.com/mitchellh/copystructure v1.2.0
github.com/securego/gosec/v2 v2.21.4
github.com/stretchr/testify v1.9.0
golang.org/x/sync v0.8.0
golang.org/x/sync v0.9.0
gotest.tools/gotestsum v1.12.0
)

require (
cloud.google.com/go v0.115.1 // indirect
cloud.google.com/go/ai v0.8.0 // indirect
cloud.google.com/go/auth v0.9.4 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.1 // indirect
cloud.google.com/go/longrunning v0.5.7 // indirect
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
Expand All @@ -43,42 +33,32 @@ require (
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/bitfield/gotestdox v0.2.2 // indirect
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
github.com/ccojocar/zxcvbn-go v1.0.2 // indirect
github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/coder/websocket v1.8.12 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/generative-ai-go v0.18.0 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/gookit/color v1.5.4 // 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-cty v1.4.1-0.20200414143053-d3edf31b6320 // 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.6.1 // indirect
github.com/hashicorp/go-plugin v1.6.2 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hc-install v0.8.0 // indirect
github.com/hashicorp/hcl/v2 v2.21.0 // indirect
github.com/hashicorp/hc-install v0.9.0 // indirect
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.21.0 // indirect
github.com/hashicorp/terraform-json v0.22.1 // indirect
github.com/hashicorp/terraform-json v0.23.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.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.1.1 // indirect
Expand All @@ -99,33 +79,22 @@ require (
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
github.com/yuin/goldmark v1.7.1 // indirect
github.com/yuin/goldmark v1.7.7 // indirect
github.com/yuin/goldmark-meta v1.1.0 // indirect
github.com/zclconf/go-cty v1.15.0 // indirect
go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
go.opentelemetry.io/otel v1.29.0 // indirect
go.opentelemetry.io/otel/metric v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.29.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.25.0 // indirect
google.golang.org/api v0.198.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/term v0.26.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.2 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 3147bd1

Please sign in to comment.