Skip to content

Commit 2008fbc

Browse files
authored
fix(repository): specify AppProject for read/delete operations (#606)
Signed-off-by: Nathanael Liechti <[email protected]>
1 parent 6139581 commit 2008fbc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

argocd/resource_argocd_repository.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func resourceArgoCDRepositoryRead(ctx context.Context, d *schema.ResourceData, m
8585
tokenMutexConfiguration.RLock()
8686
r, err := si.RepositoryClient.Get(ctx, &repository.RepoQuery{
8787
Repo: d.Id(),
88+
AppProject: d.State().Attributes["project"],
8889
ForceRefresh: true,
8990
})
9091
tokenMutexConfiguration.RUnlock()
@@ -155,7 +156,7 @@ func resourceArgoCDRepositoryDelete(ctx context.Context, d *schema.ResourceData,
155156
tokenMutexConfiguration.Lock()
156157
_, err := si.RepositoryClient.DeleteRepository(
157158
ctx,
158-
&repository.RepoQuery{Repo: d.Id()},
159+
&repository.RepoQuery{Repo: d.Id(), AppProject: d.State().Attributes["project"]},
159160
)
160161
tokenMutexConfiguration.Unlock()
161162

0 commit comments

Comments
 (0)