Skip to content

Commit

Permalink
change NOT to NOT_IN for node_affinities operator (GoogleCloudPlatfor…
Browse files Browse the repository at this point in the history
  • Loading branch information
megan07 authored and Nathan Klish committed May 18, 2020
1 parent 49b04e1 commit 6403838
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions third_party/terraform/tests/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 third_party/terraform/utils/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
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
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

0 comments on commit 6403838

Please sign in to comment.