Skip to content

Commit d5dcdd3

Browse files
authored
Merge pull request #44 from cortexapps/fix-rules-order
Fix: Rules should be a SetNestedAttribute resource everywhere
2 parents 77f8b54 + 4729a5b commit d5dcdd3

File tree

8 files changed

+40
-5
lines changed

8 files changed

+40
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ website/node_modules
2727

2828
website/vendor
2929
vendor/
30+
build/
3031

3132
# Test exclusions
3233
!command/test-fixtures/**/*.tfstate

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ Changelog for the Cortex terraform provider.
22

33
## Unreleased
44

5+
## 0.4.2
6+
* Fixes `cortex_scorecard` resource so that `rules` are a set. Order doesn't matter.
7+
58
## 0.4.1
69
* Fixes `cortex_scorecard` resource so that `description` and `filter` fields can be computed from provider response
710

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ HOSTNAME=github.com
22
NAMESPACE=cortexapps
33
NAME=cortex
44
BINARY=terraform-provider-${NAME}
5-
VERSION=0.4.2-dev
5+
VERSION=0.4.3-dev
66

77
GOOS?=$(shell go env | grep GOOS | cut -d '=' -f2 | tr -d "'")
88
GOARCH?=$(shell go env | grep GOARCH | cut -d '=' -f2 | tr -d "'")

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,37 @@ see [Requirements](#requirements) above).
7878
To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin`
7979
directory.
8080

81+
To be able to use the **locally installed provider**,
82+
83+
1. Run `go build -o build/terraform-provider-cortex .`
84+
This will build the binary and put it in the `build/` directory.
85+
86+
2. Create a `~/.terraformrc` file that lets you override the default provider location:
87+
```terraform
88+
provider_installation {
89+
dev_overrides {
90+
"cortexlocal/cortex" = "<path/to/terraform-provider-cortex/build"
91+
}
92+
direct {}
93+
}
94+
```
95+
96+
3. Use the `provider` as:
97+
98+
```terraform
99+
terraform {
100+
required_providers {
101+
cortex = {
102+
source = "cortexlocal/cortex"
103+
}
104+
}
105+
}
106+
```
107+
108+
### Documentation
109+
110+
```shell
111+
81112
To generate or update documentation, run `go generate`.
82113

83114
In order to run the full suite of Acceptance tests, run `make testacc`.

docs/data-sources/scorecard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Scorecard data source
2828
- `id` (String) The ID of this resource.
2929
- `ladder` (Attributes) (see [below for nested schema](#nestedatt--ladder))
3030
- `name` (String)
31-
- `rules` (Attributes List) Rules of the scorecard. (see [below for nested schema](#nestedatt--rules))
31+
- `rules` (Attributes Set) Rules of the scorecard. (see [below for nested schema](#nestedatt--rules))
3232

3333
<a id="nestedatt--evaluation"></a>
3434
### Nested Schema for `evaluation`

docs/resources/scorecard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Scorecard Entity
1919

2020
- `ladder` (Attributes) Ladder of the scorecard. (see [below for nested schema](#nestedatt--ladder))
2121
- `name` (String) Name of the scorecard.
22-
- `rules` (Attributes List) Rules of the scorecard. (see [below for nested schema](#nestedatt--rules))
22+
- `rules` (Attributes Set) Rules of the scorecard. (see [below for nested schema](#nestedatt--rules))
2323
- `tag` (String) Unique identifier for the scorecard.
2424

2525
### Optional

internal/provider/scorecard_data_source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (d *ScorecardDataSource) Schema(ctx context.Context, req datasource.SchemaR
8181
},
8282
},
8383
},
84-
"rules": schema.ListNestedAttribute{
84+
"rules": schema.SetNestedAttribute{
8585
MarkdownDescription: "Rules of the scorecard.",
8686
Computed: true,
8787
NestedObject: schema.NestedAttributeObject{

internal/provider/scorecard_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (r *ScorecardResource) Schema(ctx context.Context, req resource.SchemaReque
8484
},
8585
},
8686
},
87-
"rules": schema.ListNestedAttribute{
87+
"rules": schema.SetNestedAttribute{
8888
MarkdownDescription: "Rules of the scorecard.",
8989
Required: true,
9090
NestedObject: schema.NestedAttributeObject{

0 commit comments

Comments
 (0)