Skip to content

Commit b0374c0

Browse files
committed
Fix gitlab_service_slack IDs
1 parent 6b2205b commit b0374c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/provider/resource_gitlab_service_slack.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,12 @@ func resourceGitlabServiceSlackCreate(ctx context.Context, d *schema.ResourceDat
252252

253253
func resourceGitlabServiceSlackRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
254254
client := meta.(*gitlab.Client)
255-
project := d.Id()
255+
id := d.Id()
256+
project := d.Get("project").(string)
257+
if id != project && project != "" {
258+
d.SetId(project)
259+
log.Printf("[WARN] changed gitlab slack service ID from %s to its project ID %s", id, project)
260+
}
256261

257262
log.Printf("[DEBUG] read gitlab slack service for project %s", project)
258263

0 commit comments

Comments
 (0)