Skip to content

Commit 1a6c166

Browse files
committed
Upgrade to go-gitlab v0.54.3. Closes #781
1 parent fc84cc3 commit 1a6c166

6 files changed

+14
-14
lines changed

gitlab/resource_gitlab_branch_protection.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ func resourceGitlabBranchProtectionCreate(ctx context.Context, d *schema.Resourc
113113
Name: &branch,
114114
PushAccessLevel: &pushAccessLevel,
115115
MergeAccessLevel: &mergeAccessLevel,
116-
AllowedToPush: allowedToPush,
117-
AllowedToMerge: allowedToMerge,
116+
AllowedToPush: &allowedToPush,
117+
AllowedToMerge: &allowedToMerge,
118118
CodeOwnerApprovalRequired: &codeOwnerApprovalRequired,
119119
}, gitlab.WithContext(ctx))
120120
if err != nil {

gitlab/resource_gitlab_deploy_token.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func resourceGitlabDeployTokenCreate(ctx context.Context, d *schema.ResourceData
112112
Name: gitlab.String(d.Get("name").(string)),
113113
Username: gitlab.String(d.Get("username").(string)),
114114
ExpiresAt: expiresAt,
115-
Scopes: *scopes,
115+
Scopes: scopes,
116116
}
117117

118118
log.Printf("[DEBUG] Create GitLab deploy token %s in project %s", *options.Name, project.(string))
@@ -124,7 +124,7 @@ func resourceGitlabDeployTokenCreate(ctx context.Context, d *schema.ResourceData
124124
Name: gitlab.String(d.Get("name").(string)),
125125
Username: gitlab.String(d.Get("username").(string)),
126126
ExpiresAt: expiresAt,
127-
Scopes: *scopes,
127+
Scopes: scopes,
128128
}
129129

130130
log.Printf("[DEBUG] Create GitLab deploy token %s in group %s", *options.Name, group.(string))

gitlab/resource_gitlab_project_access_token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func resourceGitlabProjectAccessTokenCreate(ctx context.Context, d *schema.Resou
8585
project := d.Get("project").(string)
8686
options := &gitlab.CreateProjectAccessTokenOptions{
8787
Name: gitlab.String(d.Get("name").(string)),
88-
Scopes: *stringSetToStringSlice(d.Get("scopes").(*schema.Set)),
88+
Scopes: stringSetToStringSlice(d.Get("scopes").(*schema.Set)),
8989
}
9090

9191
log.Printf("[DEBUG] create gitlab ProjectAccessToken %s %s for project ID %s", *options.Name, options.Scopes, project)

gitlab/resource_gitlab_project_approval_rule.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,22 +240,22 @@ func flattenProtectedBranchIDs(protectedBranches []*gitlab.ProtectedBranch) []in
240240
}
241241

242242
// expandApproverIds Expands an interface into a list of ints to read from state.
243-
func expandApproverIds(ids interface{}) []int {
243+
func expandApproverIds(ids interface{}) *[]int {
244244
var approverIDs []int
245245

246246
for _, id := range ids.(*schema.Set).List() {
247247
approverIDs = append(approverIDs, id.(int))
248248
}
249249

250-
return approverIDs
250+
return &approverIDs
251251
}
252252

253-
func expandProtectedBranchIDs(ids interface{}) []int {
253+
func expandProtectedBranchIDs(ids interface{}) *[]int {
254254
var protectedBranchIDs []int
255255

256256
for _, id := range ids.(*schema.Set).List() {
257257
protectedBranchIDs = append(protectedBranchIDs, id.(int))
258258
}
259259

260-
return protectedBranchIDs
260+
return &protectedBranchIDs
261261
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ require (
99
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1
1010
github.com/mitchellh/hashstructure v1.1.0
1111
github.com/onsi/gomega v1.18.0
12-
github.com/xanzy/go-gitlab v0.51.1
12+
github.com/xanzy/go-gitlab v0.54.3
1313
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
162162
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
163163
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
164164
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
165-
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
166-
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
165+
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
166+
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
167167
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
168168
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
169169
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
@@ -391,8 +391,8 @@ github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaU
391391
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
392392
github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
393393
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
394-
github.com/xanzy/go-gitlab v0.51.1 h1:wWKLalwx4omxFoHh3PLs9zDgAD4GXDP/uoxwMRCSiWM=
395-
github.com/xanzy/go-gitlab v0.51.1/go.mod h1:Q+hQhV508bDPoBijv7YjK/Lvlb4PhVhJdKqXVQrUoAE=
394+
github.com/xanzy/go-gitlab v0.54.3 h1:fPfZ3Jcu5dPc3xyIYtAALZsEgoyKNFNuULD+TdJ7Zvk=
395+
github.com/xanzy/go-gitlab v0.54.3/go.mod h1:F0QEXwmqiBUxCgJm8fE9S+1veX4XC9Z4cfaAbqwk4YM=
396396
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
397397
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
398398
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=

0 commit comments

Comments
 (0)