Skip to content

Commit

Permalink
Replicate images with robot accounts
Browse files Browse the repository at this point in the history
Signed-off-by: Vadim Bauer <vb@container-registry.com>
  • Loading branch information
Vad1mo committed May 17, 2021
1 parent 0a8ff4c commit b76a50c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/pkg/reg/adapter/harbor/base/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,12 @@ func (c *Client) ListProjects(name string) ([]*Project, error) {

// GetProject gets the specific project
func (c *Client) GetProject(name string) (*Project, error) {
projects, err := c.ListProjects(name)
if err != nil {
project := &Project{}
url := fmt.Sprintf("%s/projects/%s", c.BasePath(), name)
if err := c.C.Get(url, project); err != nil {
return nil, err
}
for _, project := range projects {
if project.Name == name {
return project, nil
}
}
return nil, nil
return project, nil
}

// BasePath returns the API base path that contains version part
Expand Down

0 comments on commit b76a50c

Please sign in to comment.