Skip to content

Commit 1bb146e

Browse files
author
Michael Chmielewski
committed
Set Name field in the options unilaterally.
We don't need to check the name for change on an edit, since we always want to pass it in, to circumvent #1157
1 parent 7510959 commit 1bb146e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

internal/provider/resource_gitlab_project.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,14 +1208,16 @@ func resourceGitlabProjectRead(ctx context.Context, d *schema.ResourceData, meta
12081208
func resourceGitlabProjectUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
12091209
client := meta.(*gitlab.Client)
12101210

1211-
options := &gitlab.EditProjectOptions{}
1212-
transferOptions := &gitlab.TransferProjectOptions{}
1213-
12141211
// Always send the name field, to satisfy the requirement of having one
12151212
// of the project attributes listed below in the update call
12161213
// https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/lib/api/helpers/projects_helpers.rb#L120-188
1217-
// if d.HasChange("name") {
1218-
if d.Get("name").(string) != nil {
1214+
options := &gitlab.EditProjectOptions{
1215+
Name: gitlab.String(d.Get("name").(string)),
1216+
}
1217+
1218+
transferOptions := &gitlab.TransferProjectOptions{}
1219+
1220+
if d.HasChange("name") {
12191221
options.Name = gitlab.String(d.Get("name").(string))
12201222
}
12211223

0 commit comments

Comments
 (0)