Skip to content

Commit ccd0f9a

Browse files
committed
updating json schema annotation
1 parent 401aa84 commit ccd0f9a

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/hashicorp/go-multierror v1.1.1 // indirect
1313
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
1414
github.com/hashicorp/go-slug v0.14.0
15-
github.com/hashicorp/go-tfe v1.45.0
15+
github.com/hashicorp/go-tfe v1.46.0
1616
github.com/hashicorp/go-version v1.6.0
1717
github.com/hashicorp/hcl v1.0.0
1818
github.com/hashicorp/hcl/v2 v2.19.1 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWq
7373
github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ=
7474
github.com/hashicorp/go-tfe v1.45.0 h1:WCiQWUV7n1Fq/pKA9C3rhcSmUtSPTYBtE1kIJ9U0NSU=
7575
github.com/hashicorp/go-tfe v1.45.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY=
76+
github.com/hashicorp/go-tfe v1.46.0 h1:IlFh96QoC9wYag8LR7J9g0iEILWPpZ+BTqTzABvBax8=
77+
github.com/hashicorp/go-tfe v1.46.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY=
7678
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
7779
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
7880
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=

internal/provider/resource_tfe_oauth_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func resourceTFEOAuthClient() *schema.Resource {
114114

115115
"agent_pool_id": {
116116
Type: schema.TypeString,
117-
Optional: true,
117+
ForceNew: true,
118118
},
119119
},
120120
}

internal/provider/resource_tfe_oauth_client_test.go

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ func TestAccTFEOAuthClient_rsaKeys(t *testing.T) {
7676
}
7777

7878
func TestAccTFEOAuthClient_agentPool(t *testing.T) {
79-
skipUnlessBeta(t);
79+
skipUnlessBeta(t)
8080
oc := &tfe.OAuthClient{}
81-
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
82-
8381
resource.Test(t, resource.TestCase{
8482
PreCheck: func() {
8583
testAccPreCheck(t)
@@ -91,7 +89,7 @@ func TestAccTFEOAuthClient_agentPool(t *testing.T) {
9189
CheckDestroy: testAccCheckTFEOAuthClientDestroy,
9290
Steps: []resource.TestStep{
9391
{
94-
Config: testAccTFEOAuthClient_agentPool(rInt),
92+
Config: testAccTFEOAuthClient_agentPool(),
9593
Check: resource.ComposeTestCheckFunc(
9694
testAccCheckTFEOAuthClientExists("tfe_oauth_client.foobar", oc),
9795
testAccCheckTFEOAuthClientAttributes(oc),
@@ -212,24 +210,23 @@ EOT
212210
}`, rInt)
213211
}
214212

215-
func testAccTFEOAuthClient_agentPool(rInt int) string {
213+
func testAccTFEOAuthClient_agentPool() string {
216214
return fmt.Sprintf(`
217-
resource "tfe_organization" "foobar" {
218-
name = "tst-terraform-%d"
219-
215+
data "tfe_organization" "foobar" {
216+
name = "xxx"
220217
}
221218
222-
resource "tfe_agent_pool" "foobar" {
223-
name = "agent-pool-test"
224-
organization = tfe_organization.foobar.name
219+
data "tfe_agent_pool" "foobar" {
220+
name = "xxx"
221+
organization = data.tfe_organization.foobar.name
225222
}
226223
227224
resource "tfe_oauth_client" "foobar" {
228-
organization = tfe_organization.foobar.id
229-
api_url = "https://githubenterprise.xxx"
225+
organization = data.tfe_organization.foobar.name
226+
api_url = "https://githubenterprise.xxx/api/v3"
230227
http_url = "https://githubenterprise.xxx"
231228
oauth_token = "%s"
232229
service_provider = "github_enterprise"
233-
agent_pool_id = tfe_agent_pool.foobar.id
234-
}`, rInt, envGithubToken)
230+
agent_pool_id = data.tfe_agent_pool.foobar.id
231+
}`, envGithubToken)
235232
}

0 commit comments

Comments
 (0)