diff --git a/src/controller/replication/execution.go b/src/controller/replication/execution.go index bee22caee6dc..8f6d9ae509d7 100644 --- a/src/controller/replication/execution.go +++ b/src/controller/replication/execution.go @@ -21,9 +21,9 @@ import ( "time" "github.com/gocraft/work" - "github.com/goharbor/harbor/src/controller/jobmonitor" "github.com/goharbor/harbor/src/controller/event/operator" + "github.com/goharbor/harbor/src/controller/jobmonitor" "github.com/goharbor/harbor/src/controller/replication/flow" replicationmodel "github.com/goharbor/harbor/src/controller/replication/model" "github.com/goharbor/harbor/src/jobservice/job" @@ -120,7 +120,6 @@ func (c *controller) Start(ctx context.Context, policy *replicationmodel.Policy, } if policy.SkipIfRunning { - log.Infof("kumar eh policy with ID %v skipped.", policy.ID) monitorClient, err := jobmonitor.JobServiceMonitorClient() if err != nil { return 0, errors.New(nil).WithCode(errors.PreconditionCode).WithMessagef("unable to get job monitor's client: %v", err) diff --git a/src/jobservice/job/impl/replication/replication.go b/src/jobservice/job/impl/replication/replication.go index dc0de1012843..453fa5e032b5 100644 --- a/src/jobservice/job/impl/replication/replication.go +++ b/src/jobservice/job/impl/replication/replication.go @@ -17,6 +17,7 @@ package replication import ( "encoding/json" "fmt" + "github.com/goharbor/harbor/src/controller/replication/transfer" // import chart transfer _ "github.com/goharbor/harbor/src/controller/replication/transfer/image" diff --git a/src/server/v2.0/handler/replication.go b/src/server/v2.0/handler/replication.go index af4366e48e67..452e73d81715 100644 --- a/src/server/v2.0/handler/replication.go +++ b/src/server/v2.0/handler/replication.go @@ -454,7 +454,7 @@ func convertReplicationPolicy(policy *repctlmodel.Policy) *models.ReplicationPol Speed: &policy.Speed, UpdateTime: strfmt.DateTime(policy.UpdateTime), CopyByChunk: &policy.CopyByChunk, - SkipIfRunning: &policy.SkipIfRunning, + SkipIfRunning: &policy.SkipIfRunning, } if policy.SrcRegistry != nil { p.SrcRegistry = convertRegistry(policy.SrcRegistry) diff --git a/src/testing/pkg/task/execution_manager.go b/src/testing/pkg/task/execution_manager.go index bd2b7988831b..058dc14ee107 100644 --- a/src/testing/pkg/task/execution_manager.go +++ b/src/testing/pkg/task/execution_manager.go @@ -213,6 +213,24 @@ func (_m *ExecutionManager) MarkError(ctx context.Context, id int64, message str return r0 } +// MarkSkipped provides a mock function with given fields: ctx, id, message +func (_m *ExecutionManager) MarkSkipped(ctx context.Context, id int64, message string) error { + ret := _m.Called(ctx, id, message) + + if len(ret) == 0 { + panic("no return value specified for MarkSkipped") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, int64, string) error); ok { + r0 = rf(ctx, id, message) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // Stop provides a mock function with given fields: ctx, id func (_m *ExecutionManager) Stop(ctx context.Context, id int64) error { ret := _m.Called(ctx, id)