From e862168e2ef8ef12d391226e38d4abbcc6d9ad90 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Sat, 9 Sep 2023 13:36:00 +1000 Subject: [PATCH] fix: set the default page to be 1 so that pagination works properly --- internal/harbor/harbor.go | 1 + internal/harbor/harbor22x.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/harbor/harbor.go b/internal/harbor/harbor.go index 17eba76d..d2e698d3 100644 --- a/internal/harbor/harbor.go +++ b/internal/harbor/harbor.go @@ -46,6 +46,7 @@ func New(harbor Harbor) (*Harbor, error) { } harbor.ClientV3 = c harbor.Config = &config.Options{ + Page: 1, PageSize: 100, } c2, err := harborclientv5.NewRESTClientForHost(harbor.API, harbor.Username, harbor.Password, harbor.Config) diff --git a/internal/harbor/harbor22x.go b/internal/harbor/harbor22x.go index 53cd838b..70fce8a2 100644 --- a/internal/harbor/harbor22x.go +++ b/internal/harbor/harbor22x.go @@ -190,6 +190,7 @@ func (h *Harbor) CreateOrRefreshRobotV2(ctx context.Context, robots = tempRobots for _, robot := range robots { if h.matchRobotAccountV2(robot.Name, project.Name, environmentName) && robot.Editable { + h.Log.Info(fmt.Sprintf("Harbor robot account %s matched", robot.Name)) // if it is a new robot account, follow through here exists = true if forceRecreate || force {