Skip to content

Commit

Permalink
put ConflictsWith on blocks that changed from ExactlyOneOf to AtLeast…
Browse files Browse the repository at this point in the history
…OneOf (#2856)

Merged PR #2856.
  • Loading branch information
danawillow authored and modular-magician committed Dec 19, 2019
1 parent f374eb7 commit 689bffb
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/ansible
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
54 changes: 54 additions & 0 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2864,6 +2864,8 @@ objects:
at_least_one_of:
- allow
- deny
conflicts:
- denied
item_type: !ruby/object:Api::Type::NestedObject
properties:
# IPProtocol has to be string, instead of Enum because user can
Expand Down Expand Up @@ -2899,6 +2901,8 @@ objects:
at_least_one_of:
- allow
- deny
conflicts:
- allowed
description: |
The list of DENY rules specified by this firewall. Each rule specifies
a protocol and port-range tuple that describes a denied connection.
Expand Down Expand Up @@ -4054,6 +4058,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpsHealthCheck
- http2HealthCheck
- tcpHealthCheck
- sslHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -4179,6 +4188,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpHealthCheck
- http2HealthCheck
- tcpHealthCheck
- sslHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -4304,6 +4318,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpHealthCheck
- httpsHealthCheck
- http2HealthCheck
- sslHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'request'
Expand Down Expand Up @@ -4410,6 +4429,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpHealthCheck
- httpsHealthCheck
- http2HealthCheck
- tcpHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'request'
Expand Down Expand Up @@ -4516,6 +4540,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpHealthCheck
- httpsHealthCheck
- tcpHealthCheck
- sslHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -9148,6 +9177,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpsHealthCheck
- http2HealthCheck
- tcpHealthCheck
- sslHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -9273,6 +9307,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpHealthCheck
- http2HealthCheck
- tcpHealthCheck
- sslHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -9398,6 +9437,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpHealthCheck
- httpsHealthCheck
- http2HealthCheck
- sslHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'request'
Expand Down Expand Up @@ -9504,6 +9548,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpHealthCheck
- httpsHealthCheck
- http2HealthCheck
- tcpHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'request'
Expand Down Expand Up @@ -9610,6 +9659,11 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
conflicts:
- httpHealthCheck
- httpsHealthCheck
- tcpHealthCheck
- sslHealthCheck
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
MaxItems: 1,
// TODO(terraform-providers/terraform-provider-google#5193): Change back to exactly_one_of
// once hashicorp/terraform-plugin-sdk#280 is fixed
AtLeastOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
AtLeastOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
ConflictsWith: []string{"list_policy.0.deny"},
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"all": {
Expand All @@ -70,7 +71,8 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
MaxItems: 1,
// TODO(terraform-providers/terraform-provider-google#5193): Change back to exactly_one_of
// once hashicorp/terraform-plugin-sdk#280 is fixed
AtLeastOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
AtLeastOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
ConflictsWith: []string{"list_policy.0.allow"},
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"all": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestAccComputeHealthCheck_tcpAndSsl_shouldFail(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccComputeHealthCheck_tcpAndSsl_shouldFail(hckName),
ExpectError: regexp.MustCompile("only one of `http2_health_check,http_health_check,https_health_check,ssl_health_check,tcp_health_check` can be specified"),
ExpectError: regexp.MustCompile("conflicts with tcp_health_check"),
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestAccComputeRegionHealthCheck_tcpAndSsl_shouldFail(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccComputeRegionHealthCheck_tcpAndSsl_shouldFail(hckName),
ExpectError: regexp.MustCompile("only one of `http2_health_check,http_health_check,https_health_check,ssl_health_check,tcp_health_check` can be specified"),
ExpectError: regexp.MustCompile("conflicts with tcp_health_check"),
},
},
})
Expand Down

0 comments on commit 689bffb

Please sign in to comment.