Skip to content

Commit 11e44a9

Browse files
committed
Use ExactlyOneOf instead of ConflictsWith
Signed-off-by: Timo Sand <[email protected]>
1 parent 22c7e20 commit 11e44a9

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

github/provider.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ func Provider() *schema.Provider {
1818
p := &schema.Provider{
1919
Schema: map[string]*schema.Schema{
2020
"token": {
21-
Type: schema.TypeString,
22-
Optional: true,
23-
DefaultFunc: schema.EnvDefaultFunc("GITHUB_TOKEN", nil),
24-
Description: descriptions["token"],
25-
ConflictsWith: []string{"app_auth"},
21+
Type: schema.TypeString,
22+
Optional: true,
23+
DefaultFunc: schema.EnvDefaultFunc("GITHUB_TOKEN", nil),
24+
Description: descriptions["token"],
25+
ExactlyOneOf: []string{"app_auth"},
2626
},
2727
"owner": {
2828
Type: schema.TypeString,
@@ -94,11 +94,11 @@ func Provider() *schema.Provider {
9494
Description: descriptions["parallel_requests"],
9595
},
9696
"app_auth": {
97-
Type: schema.TypeList,
98-
Optional: true,
99-
MaxItems: 1,
100-
Description: descriptions["app_auth"],
101-
ConflictsWith: []string{"token"},
97+
Type: schema.TypeList,
98+
Optional: true,
99+
MaxItems: 1,
100+
Description: descriptions["app_auth"],
101+
ExactlyOneOf: []string{"token"},
102102
Elem: &schema.Resource{
103103
Schema: map[string]*schema.Schema{
104104
"id": {

github/provider_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func TestAccProviderConfigure(t *testing.T) {
245245
Steps: []resource.TestStep{
246246
{
247247
Config: config,
248-
ExpectError: regexp.MustCompile("\"app_auth\": conflicts with token"),
248+
ExpectError: regexp.MustCompile("only one of `app_auth,token` can be specified"),
249249
},
250250
},
251251
})
@@ -270,7 +270,7 @@ func TestAccProviderConfigure(t *testing.T) {
270270
Steps: []resource.TestStep{
271271
{
272272
Config: config,
273-
ExpectError: regexp.MustCompile("\"app_auth\": conflicts with token"),
273+
ExpectError: regexp.MustCompile("only one of `app_auth,token` can be specified"),
274274
},
275275
},
276276
})

0 commit comments

Comments
 (0)