Skip to content

Commit 5c1b525

Browse files
authored
Merge pull request #1074 from gitlabhq/dependabot/go_modules/github.com/hashicorp/terraform-plugin-sdk/v2-2.15.0
build(deps): bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.14.0 to 2.15.0
2 parents e761bae + 5d740fd commit 5c1b525

File tree

6 files changed

+74
-28
lines changed

6 files changed

+74
-28
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.16
55
require (
66
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
77
github.com/hashicorp/go-retryablehttp v0.7.1
8-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.14.0
8+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.15.0
99
github.com/mitchellh/hashstructure v1.1.0
1010
github.com/onsi/gomega v1.19.0
1111
github.com/xanzy/go-gitlab v0.64.0

go.sum

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
142142
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
143143
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
144144
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
145-
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
146145
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
146+
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
147+
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
147148
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
148149
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
149150
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
@@ -193,8 +194,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
193194
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
194195
github.com/hashicorp/hc-install v0.3.1 h1:VIjllE6KyAI1A244G8kTaHXy+TL5/XYzvrtFi8po/Yk=
195196
github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak=
196-
github.com/hashicorp/hcl/v2 v2.11.1 h1:yTyWcXcm9XB0TEkyU/JCRU6rYy4K+mgLtzn2wlrJbcc=
197-
github.com/hashicorp/hcl/v2 v2.11.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
197+
github.com/hashicorp/hcl/v2 v2.12.0 h1:PsYxySWpMD4KPaoJLnsHwtK5Qptvj/4Q6s0t4sUxZf4=
198+
github.com/hashicorp/hcl/v2 v2.12.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
198199
github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=
199200
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
200201
github.com/hashicorp/terraform-exec v0.16.1 h1:NAwZFJW2L2SaCBVZoVaH8LPImLOGbPLkSHy0IYbs2uE=
@@ -203,10 +204,11 @@ github.com/hashicorp/terraform-json v0.13.0 h1:Li9L+lKD1FO5RVFRM1mMMIBDoUHslOniy
203204
github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9ExU76+cpdY8zHwoazk=
204205
github.com/hashicorp/terraform-plugin-go v0.9.0 h1:FvLY/3z4SNVatPZdoFcyrlNbCar+WyyOTv5X4Tp+WZc=
205206
github.com/hashicorp/terraform-plugin-go v0.9.0/go.mod h1:EawBkgjBWNf7jiKnVoyDyF39OSV+u6KUX+Y73EPj3oM=
206-
github.com/hashicorp/terraform-plugin-log v0.3.0 h1:NPENNOjaJSVX0f7JJTl4f/2JKRPQ7S2ZN9B4NSqq5kA=
207207
github.com/hashicorp/terraform-plugin-log v0.3.0/go.mod h1:EjueSP/HjlyFAsDqt+okpCPjkT4NDynAe32AeDC4vps=
208-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.14.0 h1:GZ8NY74rxObB7QHE/JiuBW0ZEr04rlplR/TVrkgw3rw=
209-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.14.0/go.mod h1:+m4FDQ8h1ulz7zpWtqmZn2JSZQDXUVibhUShbkQVId4=
208+
github.com/hashicorp/terraform-plugin-log v0.4.0 h1:F3eVnm8r2EfQCe2k9blPIiF/r2TT01SHijXnS7bujvc=
209+
github.com/hashicorp/terraform-plugin-log v0.4.0/go.mod h1:9KclxdunFownr4pIm1jdmwKRmE4d6HVG2c9XDq47rpg=
210+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.15.0 h1:nBRM7JBvaYDV8bJjtBUyDZZrprr7UWur1/P8j4vgvqY=
211+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.15.0/go.mod h1:oCj7EsihOUat3iY2WNFQzH8OLThqjmQ6tJxsmD7Ay9U=
210212
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 h1:1FGtlkJw87UsTMg5s8jrekrHmUPUJaMcu6ELiVhQrNw=
211213
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co=
212214
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
@@ -258,8 +260,8 @@ github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9
258260
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
259261
github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0=
260262
github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA=
261-
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
262-
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
263+
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
264+
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
263265
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
264266
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
265267
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
@@ -536,7 +538,6 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f
536538
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
537539
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
538540
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
539-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
540541
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
541542
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
542543
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=

internal/provider/helper_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
1212
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1313
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
14-
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
1514
"github.com/onsi/gomega"
1615
"github.com/xanzy/go-gitlab"
1716
)
@@ -455,14 +454,6 @@ func testAccGitlabProjectStart(t *testing.T) testAccGitlabProjectContext {
455454
}
456455
}
457456

458-
// testCheckResourceAttrLazy works like resource.TestCheckResourceAttr, but lazy evaluates the value parameter.
459-
// See also: resource.TestCheckResourceAttrPtr.
460-
func testCheckResourceAttrLazy(name string, key string, value func() string) resource.TestCheckFunc {
461-
return func(s *terraform.State) error {
462-
return resource.TestCheckResourceAttr(name, key, value())(s)
463-
}
464-
}
465-
466457
func copyFile(src, dst string) error {
467458
in, err := os.Open(src)
468459
if err != nil {

internal/provider/resource_gitlab_project_environment_test.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ func TestAccGitlabProjectEnvironment_basic(t *testing.T) {
4242
Name: fmt.Sprintf("ProjectEnvironment-%d", rInt),
4343
State: "available",
4444
}),
45-
testCheckResourceAttrLazy("gitlab_project_environment.this", "created_at", func() string { return env1.CreatedAt.Format(time.RFC3339) }),
45+
resource.TestCheckResourceAttrWith("gitlab_project_environment.this", "created_at", func(value string) error {
46+
expectedValue := env1.CreatedAt.Format(time.RFC3339)
47+
if value != expectedValue {
48+
return fmt.Errorf("should be equal to %s", expectedValue)
49+
}
50+
return nil
51+
}),
4652
),
4753
},
4854
// Verify import
@@ -62,8 +68,20 @@ func TestAccGitlabProjectEnvironment_basic(t *testing.T) {
6268
State: "available",
6369
ExternalURL: "https://example.com",
6470
}),
65-
testCheckResourceAttrLazy("gitlab_project_environment.this", "created_at", func() string { return env2.CreatedAt.Format(time.RFC3339) }),
66-
testCheckResourceAttrLazy("gitlab_project_environment.this", "updated_at", func() string { return env2.UpdatedAt.Format(time.RFC3339) }),
71+
resource.TestCheckResourceAttrWith("gitlab_project_environment.this", "created_at", func(value string) error {
72+
expectedValue := env2.CreatedAt.Format(time.RFC3339)
73+
if value != expectedValue {
74+
return fmt.Errorf("should be equal to %s", expectedValue)
75+
}
76+
return nil
77+
}),
78+
resource.TestCheckResourceAttrWith("gitlab_project_environment.this", "updated_at", func(value string) error {
79+
expectedValue := env2.UpdatedAt.Format(time.RFC3339)
80+
if value != expectedValue {
81+
return fmt.Errorf("should be equal to %s", expectedValue)
82+
}
83+
return nil
84+
}),
6785
),
6886
},
6987
// Verify import

internal/provider/resource_gitlab_project_issue_test.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ func TestAccGitlabProjectIssue_basic(t *testing.T) {
4040
resource.TestCheckResourceAttr("gitlab_project_issue.this", "project", testProject.PathWithNamespace),
4141
resource.TestCheckResourceAttr("gitlab_project_issue.this", "iid", "1"),
4242
resource.TestCheckResourceAttr("gitlab_project_issue.this", "title", "Terraform test issue"),
43-
testCheckResourceAttrLazy("gitlab_project_issue.this", "created_at", func() string { return testIssue.CreatedAt.Format(time.RFC3339) }),
43+
resource.TestCheckResourceAttrWith("gitlab_project_issue.this", "created_at", func(value string) error {
44+
expectedValue := testIssue.CreatedAt.Format(time.RFC3339)
45+
if value != expectedValue {
46+
return fmt.Errorf("should be equal to %s", expectedValue)
47+
}
48+
return nil
49+
}),
4450
),
4551
},
4652
// Verify import
@@ -58,7 +64,13 @@ func TestAccGitlabProjectIssue_basic(t *testing.T) {
5864
resource.TestCheckResourceAttr("gitlab_project_issue.this", "project", testProject.PathWithNamespace),
5965
resource.TestCheckResourceAttr("gitlab_project_issue.this", "iid", "1"),
6066
resource.TestCheckResourceAttr("gitlab_project_issue.this", "title", "Terraform test issue"),
61-
testCheckResourceAttrLazy("gitlab_project_issue.this", "updated_at", func() string { return updatedTestIssue.UpdatedAt.Format(time.RFC3339) }),
67+
resource.TestCheckResourceAttrWith("gitlab_project_issue.this", "updated_at", func(value string) error {
68+
expectedValue := updatedTestIssue.UpdatedAt.Format(time.RFC3339)
69+
if value != expectedValue {
70+
return fmt.Errorf("should be equal to %s", expectedValue)
71+
}
72+
return nil
73+
}),
6274
),
6375
},
6476
// Verify import
@@ -97,7 +109,13 @@ func TestAccGitlabProjectIssue_basic(t *testing.T) {
97109
Check: resource.ComposeTestCheckFunc(
98110
testAccCheckGitlabProjectIssueExists("gitlab_project_issue.this", &testIssue),
99111
resource.TestCheckResourceAttr("gitlab_project_issue.this", "state", "closed"),
100-
testCheckResourceAttrLazy("gitlab_project_issue.this", "closed_at", func() string { return testIssue.ClosedAt.Format(time.RFC3339) }),
112+
resource.TestCheckResourceAttrWith("gitlab_project_issue.this", "closed_at", func(value string) error {
113+
expectedValue := testIssue.ClosedAt.Format(time.RFC3339)
114+
if value != expectedValue {
115+
return fmt.Errorf("should be equal to %s", expectedValue)
116+
}
117+
return nil
118+
}),
101119
resource.TestCheckResourceAttr("gitlab_project_issue.this", "closed_by_user_id", fmt.Sprintf("%d", currentUser.ID)),
102120
),
103121
},

internal/provider/resource_gitlab_service_external_wiki_test.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ func TestAccGitlabServiceExternalWiki_basic(t *testing.T) {
3434
resource.TestCheckResourceAttr(externalWikiResourceName, "external_wiki_url", externalWikiURL1),
3535
resource.TestCheckResourceAttr(externalWikiResourceName, "external_wiki_url", externalWikiURL1),
3636
resource.TestCheckResourceAttr(externalWikiResourceName, "active", "true"),
37-
testCheckResourceAttrLazy(externalWikiResourceName, "created_at", func() string { return externalWikiService.CreatedAt.Format(time.RFC3339) }),
37+
resource.TestCheckResourceAttrWith(externalWikiResourceName, "created_at", func(value string) error {
38+
expectedValue := externalWikiService.CreatedAt.Format(time.RFC3339)
39+
if value != expectedValue {
40+
return fmt.Errorf("should be equal to %s", expectedValue)
41+
}
42+
return nil
43+
}),
3844
),
3945
},
4046
// Verify import
@@ -49,8 +55,20 @@ func TestAccGitlabServiceExternalWiki_basic(t *testing.T) {
4955
Check: resource.ComposeTestCheckFunc(
5056
testAccCheckGitlabServiceExternalWikiExists(externalWikiResourceName, &externalWikiService),
5157
resource.TestCheckResourceAttr(externalWikiResourceName, "external_wiki_url", externalWikiURL2),
52-
testCheckResourceAttrLazy(externalWikiResourceName, "created_at", func() string { return externalWikiService.CreatedAt.Format(time.RFC3339) }),
53-
testCheckResourceAttrLazy(externalWikiResourceName, "updated_at", func() string { return externalWikiService.UpdatedAt.Format(time.RFC3339) }),
58+
resource.TestCheckResourceAttrWith(externalWikiResourceName, "created_at", func(value string) error {
59+
expectedValue := externalWikiService.CreatedAt.Format(time.RFC3339)
60+
if value != expectedValue {
61+
return fmt.Errorf("should be equal to %s", expectedValue)
62+
}
63+
return nil
64+
}),
65+
resource.TestCheckResourceAttrWith(externalWikiResourceName, "updated_at", func(value string) error {
66+
expectedValue := externalWikiService.UpdatedAt.Format(time.RFC3339)
67+
if value != expectedValue {
68+
return fmt.Errorf("should be equal to %s", expectedValue)
69+
}
70+
return nil
71+
}),
5472
),
5573
},
5674
// Verify import

0 commit comments

Comments
 (0)