Skip to content

Commit

Permalink
Merge pull request #146 from fluxcd/iterate-on-projects-prior-to-retu…
Browse files Browse the repository at this point in the history
…nring-it

[Stash] Look for the exact projectName in the returned project list
  • Loading branch information
stefanprodan authored Feb 12, 2022
2 parents 5d55818 + fc4121a commit 3be74ba
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions stash/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,16 @@ func (s *ProjectsService) Get(ctx context.Context, projectName string) (*Project
return nil, ErrNotFound
}

p.Projects[0].Session.set(resp)
return p.Projects[0], nil
// find the project
for i := range p.Projects {
if p.Projects[i].Name == projectName {
// Found!
p.Projects[i].Session.set(resp)
return p.Projects[i], nil
}
}

return nil, ErrNotFound

}

Expand Down

0 comments on commit 3be74ba

Please sign in to comment.