From 6c806259c137add355fda839cdb8ce6d228ea212 Mon Sep 17 00:00:00 2001 From: Jeremy Udit Date: Tue, 1 Sep 2020 18:52:01 -0400 Subject: [PATCH] Add `ConflictsWith` Schema Relation /cc https://github.com/terraform-providers/terraform-provider-github/pull/521#discussion_r461594934 --- github/provider.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/github/provider.go b/github/provider.go index f5d98f7f6b..193d520521 100644 --- a/github/provider.go +++ b/github/provider.go @@ -15,16 +15,18 @@ func Provider() terraform.ResourceProvider { Description: descriptions["token"], }, "owner": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: OwnerOrOrgEnvDefaultFunc, - Description: descriptions["owner"], + Type: schema.TypeString, + Optional: true, + DefaultFunc: schema.EnvDefaultFunc("GITHUB_OWNER", nil), + Description: descriptions["owner"], + ConflictsWith: []string{"organization"}, }, "organization": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: OwnerOrOrgEnvDefaultFunc, - Description: descriptions["organization"], + Type: schema.TypeString, + Optional: true, + DefaultFunc: schema.EnvDefaultFunc("GITHUB_ORGANIZATION", nil), + Description: descriptions["organization"], + ConflictsWith: []string{"owner"}, }, "base_url": { Type: schema.TypeString,