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

put ConflictsWith on blocks that changed from ExactlyOneOf to AtLeastOneOf #5220

Merged
merged 1 commit into from
Dec 19, 2019
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
14 changes: 8 additions & 6 deletions google/resource_compute_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,20 @@ character, which cannot be a dash.`,
Description: `The list of ALLOW rules specified by this firewall. Each rule
specifies a protocol and port-range tuple that describes a permitted
connection.`,
Elem: computeFirewallAllowSchema(),
Set: resourceComputeFirewallRuleHash,
AtLeastOneOf: []string{"allow", "deny"},
Elem: computeFirewallAllowSchema(),
Set: resourceComputeFirewallRuleHash,
ConflictsWith: []string{"deny"},
AtLeastOneOf: []string{"allow", "deny"},
},
"deny": {
Type: schema.TypeSet,
Optional: true,
Description: `The list of DENY rules specified by this firewall. Each rule specifies
a protocol and port-range tuple that describes a denied connection.`,
Elem: computeFirewallDenySchema(),
Set: resourceComputeFirewallRuleHash,
AtLeastOneOf: []string{"allow", "deny"},
Elem: computeFirewallDenySchema(),
Set: resourceComputeFirewallRuleHash,
ConflictsWith: []string{"allow"},
AtLeastOneOf: []string{"allow", "deny"},
},
"description": {
Type: schema.TypeString,
Expand Down
15 changes: 10 additions & 5 deletions google/resource_compute_health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"http_health_check", "https_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"http_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -316,7 +317,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"https_health_check", "tcp_health_check", "ssl_health_check", "http2_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"https_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -395,7 +397,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"http_health_check", "tcp_health_check", "ssl_health_check", "http2_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"ssl_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -467,7 +470,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"http_health_check", "https_health_check", "tcp_health_check", "http2_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"tcp_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -539,7 +543,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"http_health_check", "https_health_check", "ssl_health_check", "http2_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"timeout_sec": {
Type: schema.TypeInt,
Expand Down
2 changes: 1 addition & 1 deletion google/resource_compute_health_check_test.go
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
15 changes: 10 additions & 5 deletions google/resource_compute_region_health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"http_health_check", "https_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"http_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -233,7 +234,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"https_health_check", "tcp_health_check", "ssl_health_check", "http2_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"https_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -312,7 +314,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"http_health_check", "tcp_health_check", "ssl_health_check", "http2_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"region": {
Type: schema.TypeString,
Expand Down Expand Up @@ -393,7 +396,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"http_health_check", "https_health_check", "tcp_health_check", "http2_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"tcp_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -465,7 +469,8 @@ can only be ASCII.`,
},
},
},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
ConflictsWith: []string{"http_health_check", "https_health_check", "ssl_health_check", "http2_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"timeout_sec": {
Type: schema.TypeInt,
Expand Down
2 changes: 1 addition & 1 deletion google/resource_compute_region_health_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,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
6 changes: 4 additions & 2 deletions google/resource_google_organization_policy.go
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