Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change NOT to NOT_IN for node_affinities operator #5841

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3225.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
compute: fixed bug where `google_compute_instance.scheduling.node_affinities.operator` would incorrectly accept `NOT` rather than `NOT_IN`.
```
2 changes: 1 addition & 1 deletion google/compute_instance_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func instanceSchedulingNodeAffinitiesElemSchema() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"IN", "NOT"}, false),
ValidateFunc: validation.StringInSlice([]string{"IN", "NOT_IN"}, false),
},
"values": {
Type: schema.TypeSet,
Expand Down
12 changes: 12 additions & 0 deletions google/resource_compute_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4240,6 +4240,12 @@ resource "google_compute_instance" "foobar" {
values = ["test"]
}

node_affinities {
key = "tfacc"
operator = "NOT_IN"
values = ["not_here"]
}

node_affinities {
key = "compute.googleapis.com/node-group-name"
operator = "IN"
Expand Down Expand Up @@ -4302,6 +4308,12 @@ resource "google_compute_instance" "foobar" {
values = ["test", "updatedlabel"]
}

node_affinities {
key = "tfacc"
operator = "NOT_IN"
values = ["not_here"]
}

node_affinities {
key = "compute.googleapis.com/node-group-name"
operator = "IN"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/compute_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ The `node_affinities` block supports:
* `key` (Required) - The key for the node affinity label.

* `operator` (Required) - The operator. Can be `IN` for node-affinities
or `NOT` for anti-affinities.
or `NOT_IN` for anti-affinities.

* `value` (Required) - The values for the node affinity label.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/compute_instance_template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ The `node_affinities` block supports:
* `key` (Required) - The key for the node affinity label.

* `operator` (Required) - The operator. Can be `IN` for node-affinities
or `NOT` for anti-affinities.
or `NOT_IN` for anti-affinities.

* `value` (Required) - The values for the node affinity label.

Expand Down