Skip to content

Commit 2073574

Browse files
authored
feat!: Upgrade TF SDK to v2 (#43)
* feat!: Upgrade TF SDK to v2 - feat!: Remove resource sysdig_secure_notification_channel - ci: Change the usage of sysdig_secure_notification_channel in tests with the corresponding ones - feat: Add new data source sysdig_current_user that can be used in other resources to reference the calling user - fix: Some resource properties were not being correctly set, now with TF SDK v2 we can detect properly if they are set and updated correctly. - docs: Add documentation for sysdig_monitor_team and sysdig_secure_team resources. - feat: Admins will be ignored from the team creation since they are added by default. By default all admins in the account are added to the new created teams, so we can ignore all of them as if they were not in the resource.
1 parent 7df9384 commit 2073574

File tree

92 files changed

+1121
-959
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1121
-959
lines changed

.github/workflows/ci-master-update-docs.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ jobs:
1414

1515
steps:
1616

17-
- name: Check out code
18-
uses: actions/checkout@v2
19-
20-
- name: Generate docs from files
21-
run: |
22-
cd docs
23-
./generate.sh > usage.md
24-
25-
- name: Commit updated docs
26-
run: |
27-
git config user.email "[email protected]"
28-
git config user.name "Github Actions"
29-
git add docs
30-
31-
git commit -m "docs: Automatic documentation update"
32-
git push origin HEAD:${GITHUB_REF}
17+
- name: Check out code
18+
uses: actions/checkout@v2
19+
20+
- name: Generate docs from files
21+
run: |
22+
cd docs
23+
./generate.sh > usage.md
24+
25+
- name: Commit updated docs
26+
run: |
27+
git config user.email "[email protected]"
28+
git config user.name "Github Actions"
29+
git add docs
30+
31+
git commit -m "docs: Automatic documentation update"
32+
git push origin HEAD:${GITHUB_REF}
3333

.github/workflows/ci-master.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI - Master
33
on:
44
push:
55
branches:
6-
- master
6+
- master
77

88
jobs:
99
build-multiarch:
@@ -37,56 +37,56 @@ jobs:
3737
- os: windows
3838
arch: amd64
3939
steps:
40-
- name: Checkout code
41-
uses: actions/checkout@v2
40+
- name: Checkout code
41+
uses: actions/checkout@v2
4242

43-
- name: Build project
44-
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o terraform-provider-sysdig
43+
- name: Build project
44+
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o terraform-provider-sysdig
4545

4646
test:
4747
name: Test
4848
runs-on: ubuntu-latest
4949

5050
steps:
51-
- name: Check out code
52-
uses: actions/checkout@v2
51+
- name: Check out code
52+
uses: actions/checkout@v2
5353

54-
- name: Set up Go
55-
uses: actions/setup-go@v2
56-
with:
57-
go-version: ^1.14
54+
- name: Set up Go
55+
uses: actions/setup-go@v2
56+
with:
57+
go-version: ^1.14
5858

59-
- name: Cache modules
60-
uses: actions/cache@v1
61-
with:
62-
path: ~/go/pkg/mod
63-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
64-
restore-keys: |
65-
${{ runner.os }}-go-
59+
- name: Cache modules
60+
uses: actions/cache@v1
61+
with:
62+
path: ~/go/pkg/mod
63+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
64+
restore-keys: |
65+
${{ runner.os }}-go-
6666
67-
- name: Get dependencies
68-
run: |
69-
go get -u -v github.com/onsi/ginkgo/ginkgo
67+
- name: Get dependencies
68+
run: |
69+
go get -u -v github.com/onsi/ginkgo/ginkgo
7070
71-
- name: Test
72-
run: make test
71+
- name: Test
72+
run: make test
7373

74-
- name: Acceptance tests
75-
run: make testacc
76-
env:
77-
SYSDIG_MONITOR_API_TOKEN: ${{ secrets.KUBELAB_MONITOR_API_TOKEN }}
78-
SYSDIG_SECURE_API_TOKEN: ${{ secrets.KUBELAB_SECURE_API_TOKEN }}
74+
- name: Acceptance tests
75+
run: make testacc
76+
env:
77+
SYSDIG_MONITOR_API_TOKEN: ${{ secrets.KUBELAB_MONITOR_API_TOKEN }}
78+
SYSDIG_SECURE_API_TOKEN: ${{ secrets.KUBELAB_SECURE_API_TOKEN }}
7979

8080
lint:
8181
name: Lint
8282
runs-on: ubuntu-latest
8383

8484
steps:
85-
- name: Check out code
86-
uses: actions/checkout@v2
85+
- name: Check out code
86+
uses: actions/checkout@v2
8787

88-
- name: Lint
89-
continue-on-error: true
90-
uses: golangci/golangci-lint-action@v1
91-
with:
92-
version: v1.27
88+
- name: Lint
89+
continue-on-error: true
90+
uses: golangci/golangci-lint-action@v1
91+
with:
92+
version: v1.27

.github/workflows/ci-pull-request.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI - Pull Request
33
on:
44
pull_request:
55
branches:
6-
- master
6+
- master
77

88
jobs:
99
build-multiarch:
@@ -37,56 +37,56 @@ jobs:
3737
- os: windows
3838
arch: amd64
3939
steps:
40-
- name: Checkout code
41-
uses: actions/checkout@v2
40+
- name: Checkout code
41+
uses: actions/checkout@v2
4242

43-
- name: Build project
44-
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o terraform-provider-sysdig
43+
- name: Build project
44+
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o terraform-provider-sysdig
4545

4646
test:
4747
name: Test
4848
runs-on: ubuntu-latest
4949

5050
steps:
51-
- name: Check out code
52-
uses: actions/checkout@v2
51+
- name: Check out code
52+
uses: actions/checkout@v2
5353

54-
- name: Set up Go
55-
uses: actions/setup-go@v2
56-
with:
57-
go-version: ^1.14
54+
- name: Set up Go
55+
uses: actions/setup-go@v2
56+
with:
57+
go-version: ^1.14
5858

59-
- name: Cache modules
60-
uses: actions/cache@v1
61-
with:
62-
path: ~/go/pkg/mod
63-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
64-
restore-keys: |
65-
${{ runner.os }}-go-
59+
- name: Cache modules
60+
uses: actions/cache@v1
61+
with:
62+
path: ~/go/pkg/mod
63+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
64+
restore-keys: |
65+
${{ runner.os }}-go-
6666
67-
- name: Get dependencies
68-
run: |
69-
go get -u -v github.com/onsi/ginkgo/ginkgo
67+
- name: Get dependencies
68+
run: |
69+
go get -u -v github.com/onsi/ginkgo/ginkgo
7070
71-
- name: Test
72-
run: make test
71+
- name: Test
72+
run: make test
7373

74-
- name: Acceptance tests
75-
run: make testacc
76-
env:
77-
SYSDIG_MONITOR_API_TOKEN: ${{ secrets.KUBELAB_MONITOR_API_TOKEN }}
78-
SYSDIG_SECURE_API_TOKEN: ${{ secrets.KUBELAB_SECURE_API_TOKEN }}
74+
- name: Acceptance tests
75+
run: make testacc
76+
env:
77+
SYSDIG_MONITOR_API_TOKEN: ${{ secrets.KUBELAB_MONITOR_API_TOKEN }}
78+
SYSDIG_SECURE_API_TOKEN: ${{ secrets.KUBELAB_SECURE_API_TOKEN }}
7979

8080
lint:
8181
name: Lint
8282
runs-on: ubuntu-latest
8383

8484
steps:
85-
- name: Check out code
86-
uses: actions/checkout@v2
85+
- name: Check out code
86+
uses: actions/checkout@v2
8787

88-
- name: Lint
89-
continue-on-error: true
90-
uses: golangci/golangci-lint-action@v1
91-
with:
92-
version: v1.27
88+
- name: Lint
89+
continue-on-error: true
90+
uses: golangci/golangci-lint-action@v1
91+
with:
92+
version: v1.27

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module github.com/draios/terraform-provider-sysdig
33
go 1.12
44

55
require (
6-
github.com/hashicorp/terraform-plugin-sdk v1.13.0
6+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.3
77
github.com/spf13/cast v1.3.1
88
)

0 commit comments

Comments
 (0)