You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Go](https://golang.org/doc/install) > Go version specified in [go.mod](./go.mod#L3)
31
26
- Correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
32
27
33
-
###Develop
28
+
## Develop
34
29
35
30
First **clone** source repository to: `$GOPATH/src/github.com/draios/terraform-provider-sysdig`
36
31
@@ -40,37 +35,36 @@ $ cd terraform-provider-sysdig
40
35
$ make build
41
36
```
42
37
43
-
### Compile
38
+
If you're a rookie, check [Official Terraform Provider development guides](https://developer.hashicorp.com/terraform/plugin/frameworkO)
39
+
40
+
### Creating new resource / data sources
41
+
42
+
TL;DR;
43
+
- Create the resource/data source item
44
+
- Add the created item into the `provider.go` resource or datasource map with its wiring
45
+
- With its [acceptance **test**](#tests)
46
+
- Add its **documentation** page on `./website/docs/`
47
+
48
+
## Compile
44
49
45
50
To **compile** the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
46
51
47
52
```sh
48
53
$ make build
49
-
...
50
54
$ $GOPATH/bin/terraform-provider-sysdig
51
-
...
52
55
```
53
56
54
-
### Tests
55
-
In order to **test** the provider, you can simply run `make test`.
57
+
## Tests
56
58
57
-
```sh
58
-
$ make test
59
-
```
59
+
In order to **test** the provider, you can simply run `make test` to run unit-tests.
60
+
For acceptance tests, you can run `make testacc`, but note that
61
+
- Sysdig Montir and/or Secure credentials are required, check [`/.envrc.template`](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.envrc.template)
62
+
-**acceptance tests rely on the creation of real infrastructure**, you should execute them in an environment where you can remove the resources easily.
60
63
61
-
### Acceptance Tests
64
+
If you're a rookie, check [Terraform acceptance test guidelines](https://developer.hashicorp.com/terraform/plugin/testing)
62
65
63
-
If you want to execute the **acceptance tests**, you can run `make testacc`.
64
-
- Follow [Terraform acceptance test guideliness](https://www.terraform.io/plugin/sdkv2/testing/acceptance-tests)
65
-
- Please note that you need a token for Sysdig Monitor and another one for Sysdig Secure, and since the **acceptance tests create real infrastructure**
66
-
you should execute them in an environment where you can remove the resources easily.
67
-
- Acceptance tests are launched in [Sysdig production `+kubelab` test environment](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.github/workflows/ci-pull-request.yml#L82-L83)
68
66
69
-
```sh
70
-
$ make testacc
71
-
```
72
-
73
-
### Install (local)
67
+
## Install (local)
74
68
To use the local provider you just built, follow the instructions to [**install** it as a plugin.](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin) in your machine with:
75
69
76
70
```sh
@@ -100,20 +94,6 @@ To uninstall the plugin:
100
94
$ make uninstall
101
95
```
102
96
103
-
### Creating new resource / data sources
104
-
105
-
TL;DR;
106
-
- Create the resource/data source item
107
-
- Add the created item into the `provider.go` resource or datasource map with its wiring
108
-
- With its [acceptance **test**](#acceptance-tests)
109
-
- Add its **documentation** page on `./website/docs/`
* if it's your first time, validate you're taking into account every aspect of the [`./github/pull_request_template`](.github/pull_request_template.md)
@@ -122,7 +102,7 @@ Interesting resources
122
102
- You can work on this before even pushing to remote, using [**pre-commit**](https://pre-commit.com) plugin
123
103
124
104
* for the PR title use [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/) so when the branch is squashed to main branch it follows a convention
125
-
*for Acceptance Tests `testacc` some credentials are required, check [`/.envrc.template`](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.envrc.template)
105
+
*acceptance tests are launched in [Sysdig production `+kubelab` test environment](https://github.com/sysdiglabs/terraform-provider-sysdig/blob/master/.github/workflows/ci-pull-request.yml#L82-L83)
// internal type redefintion for GCP service principals.
560
560
// This exists because in terraform, the key is originally provided in the form of a base64 encoded json string
561
+
562
+
// note; caution with order of fields, they have to go in alphabetical ASC so that the json marshalled on the tf read phase produces no drift https://github.com/golang/go/issues/27179
0 commit comments