Skip to content

Commit aa077bc

Browse files
authored
Merge pull request #892 from timofurrer/bugfix/issue-890
resource/gitlab_branch_protection: fix issue claiming that no valid access level can be found. Closes #890
2 parents d2c6ece + a57f5ee commit aa077bc

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 3.10.0 (2022-02-24)
2+
3+
BUG FIXES:
4+
5+
* resource/gitlab_branch_protection: Fix issue which claimed that `no valid access level` can be found ([#892](https://github.com/gitlabhq/terraform-provider-gitlab/pull/892))
6+
17
## 3.10.0 (2022-02-23)
28

39
FEATURES:
@@ -19,7 +25,7 @@ IMPROVEMENTS:
1925
* resource/gitlab_service_jira: Add `api_url` attribute ([#597](https://github.com/gitlabhq/terraform-provider-gitlab/pull/597))
2026
* resource/gitlab_user: Add `state` attribute to allow blocking users ([#762](https://github.com/gitlabhq/terraform-provider-gitlab/pull/762))
2127

22-
BUG FIXES
28+
BUG FIXES:
2329

2430
* datasource/gitlab_projects: Allow to get archived and unarchived repositories ([#855](https://github.com/gitlabhq/terraform-provider-gitlab/pull/855))
2531
* resource/gitlab_group: Support setting `default_branch_protection` to `0` ([#856](https://github.com/gitlabhq/terraform-provider-gitlab/pull/856))

internal/provider/resource_gitlab_branch_protection.go

-4
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,12 @@ func resourceGitlabBranchProtectionRead(ctx context.Context, d *schema.ResourceD
173173
if err := d.Set("push_access_level", accessLevelValueToName[*pushAccessLevel]); err != nil {
174174
return diag.Errorf("error setting push_access_level: %v", err)
175175
}
176-
} else {
177-
return diag.Errorf("unable to get push_access_level: %v", err)
178176
}
179177

180178
if mergeAccessLevels, err := firstValidAccessLevel(pb.MergeAccessLevels); err == nil {
181179
if err := d.Set("merge_access_level", accessLevelValueToName[*mergeAccessLevels]); err != nil {
182180
return diag.Errorf("error setting merge_access_level: %v", err)
183181
}
184-
} else {
185-
return diag.Errorf("unable to get merge_access_level: %v", err)
186182
}
187183

188184
if err := d.Set("allow_force_push", pb.AllowForcePush); err != nil {

0 commit comments

Comments
 (0)