Skip to content

Commit 3507e53

Browse files
committed
fix project deletion panics (#39)
1 parent f703e45 commit 3507e53

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

argocd/resource_argocd_project.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ func resourceArgoCDProjectDelete(d *schema.ResourceData, meta interface{}) error
169169
server := meta.(ServerInterface)
170170
c := *server.ProjectClient
171171
projectName := d.Id()
172+
if _, ok := tokenMutexProjectMap[projectName]; !ok {
173+
tokenMutexProjectMap[projectName] = &sync.RWMutex{}
174+
}
172175

173176
tokenMutexProjectMap[projectName].Lock()
174177
_, err := c.Delete(context.Background(), &projectClient.ProjectQuery{Name: projectName})

0 commit comments

Comments
 (0)