Skip to content

Commit b952389

Browse files
committed
Upgrade to go 1.19
1 parent 6cb41a6 commit b952389

9 files changed

+23
-570
lines changed

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.17
1+
1.19

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Documentation in [/docs](/docs) is auto-generated by [terraform-plugin-docs](htt
6262

6363
### Set Up Your Local Environment
6464

65-
You'll first need [Go](http://www.golang.org) installed on your machine (version 1.17+ is *required*).
65+
You'll first need [Go](http://www.golang.org) installed on your machine (version 1.19+ is *required*).
6666

6767
1. Clone the git repository.
6868

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/gitlabhq/terraform-provider-gitlab
22

3-
go 1.17
3+
go 1.19
44

55
require (
66
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320

go.sum

Lines changed: 0 additions & 549 deletions
Large diffs are not rendered by default.

internal/provider/access_level_helpers.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ var validProjectAccessLevelNames = []string{
4444
}
4545

4646
// NOTE(TF): the documentation here https://docs.gitlab.com/ee/api/protected_branches.html
47-
// mentions an `60 => Admin access` level, but it actually seems to not exist.
48-
// Ignoring here that I've every read about this ...
47+
//
48+
// mentions an `60 => Admin access` level, but it actually seems to not exist.
49+
// Ignoring here that I've every read about this ...
4950
var validProtectedBranchTagAccessLevelNames = []string{
5051
"no one", "developer", "maintainer",
5152
}

internal/provider/data_source_gitlab_project.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ var _ = registerDataSource("gitlab_project", func() *schema.Resource {
249249
},
250250
"repository_storage": {
251251
Description: " Which storage shard the repository is on. (administrator only)",
252-
Type: schema.TypeString,
253-
Computed: true,
252+
Type: schema.TypeString,
253+
Computed: true,
254254
},
255255
"requirements_access_level": {
256256
Description: fmt.Sprintf("Set the requirements access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),

internal/provider/data_source_gitlab_projects.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,8 @@ var _ = registerDataSource("gitlab_projects", func() *schema.Resource {
905905
},
906906
"repository_storage": {
907907
Description: " Which storage shard the repository is on. (administrator only)",
908-
Type: schema.TypeString,
909-
Computed: true,
908+
Type: schema.TypeString,
909+
Computed: true,
910910
},
911911
"requirements_access_level": {
912912
Description: fmt.Sprintf("Set the requirements access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),

internal/provider/resource_gitlab_project.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,9 @@ var resourceGitLabProjectSchema = map[string]*schema.Schema{
539539
},
540540
"repository_storage": {
541541
Description: " Which storage shard the repository is on. (administrator only)",
542-
Type: schema.TypeString,
543-
Optional: true,
544-
Computed: true,
542+
Type: schema.TypeString,
543+
Optional: true,
544+
Computed: true,
545545
},
546546
"requirements_access_level": {
547547
Description: fmt.Sprintf("Set the requirements access level. Valid values are %s.", renderValueListForDocs(validProjectAccessLevels)),

internal/provider/resource_gitlab_repository_file.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ import (
1919
const encoding = "base64"
2020

2121
// NOTE: this lock is a bit of a hack to prevent parallel calls to the GitLab Repository Files API.
22-
// If it is called concurrently, the API will return a 400 error along the lines of:
23-
// ```
24-
// (400 Bad Request) DELETE https://gitlab.com/api/v4/projects/30716/repository/files/somefile.yaml: 400
25-
// {message: 9:Could not update refs/heads/master. Please refresh and try again..}
26-
// ```
2722
//
28-
// This lock only solves half of the problem, where the provider is responsible for
29-
// the concurrency. The other half is if the API is called outside of terraform at the same time
30-
// this resource makes calls to the API.
31-
// To mitigate this, simple retries are used.
23+
// If it is called concurrently, the API will return a 400 error along the lines of:
24+
// ```
25+
// (400 Bad Request) DELETE https://gitlab.com/api/v4/projects/30716/repository/files/somefile.yaml: 400
26+
// {message: 9:Could not update refs/heads/master. Please refresh and try again..}
27+
// ```
28+
//
29+
// This lock only solves half of the problem, where the provider is responsible for
30+
// the concurrency. The other half is if the API is called outside of terraform at the same time
31+
// this resource makes calls to the API.
32+
// To mitigate this, simple retries are used.
3233
var resourceGitlabRepositoryFileApiLock = newLock()
3334

3435
var _ = registerResource("gitlab_repository_file", func() *schema.Resource {

0 commit comments

Comments
 (0)