Skip to content

Commit 3e24aff

Browse files
committed
Set merge_access_level, push_access_level to optional
`merge_access_level` and `push_access_level` are marked as optional in the API. This updates them to match; previously they were marked as required in the provider. This also defines the default for them that matches the API.
1 parent b152181 commit 3e24aff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/provider/resource_gitlab_branch_protection.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,16 @@ var _ = registerResource("gitlab_branch_protection", func() *schema.Resource {
7171
Description: fmt.Sprintf("Access levels allowed to merge. Valid values are: %s.", renderValueListForDocs(validProtectedBranchTagAccessLevelNames)),
7272
Type: schema.TypeString,
7373
ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice(validProtectedBranchTagAccessLevelNames, false)),
74-
Required: true,
74+
Optional: true,
75+
Default: accessLevelValueToName[gitlab.MaintainerPermissions],
7576
ForceNew: true,
7677
},
7778
"push_access_level": {
7879
Description: fmt.Sprintf("Access levels allowed to push. Valid values are: %s.", renderValueListForDocs(validProtectedBranchTagAccessLevelNames)),
7980
Type: schema.TypeString,
8081
ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice(validProtectedBranchTagAccessLevelNames, false)),
81-
Required: true,
82+
Optional: true,
83+
Default: accessLevelValueToName[gitlab.MaintainerPermissions],
8284
ForceNew: true,
8385
},
8486
"allow_force_push": {

0 commit comments

Comments
 (0)