mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-23 16:11:24 +01:00
fix gc schedule issue (#18934)
fixes #18881 Save workers settings into the metadata of the garbage collection schedule Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
ff2b99d711
commit
d745ad9175
@ -205,6 +205,7 @@ func (c *controller) GetSchedule(ctx context.Context) (*scheduler.Schedule, erro
|
||||
func (c *controller) CreateSchedule(ctx context.Context, cronType, cron string, policy Policy) (int64, error) {
|
||||
extras := make(map[string]interface{})
|
||||
extras["delete_untagged"] = policy.DeleteUntagged
|
||||
extras["workers"] = policy.Workers
|
||||
return c.schedulerMgr.Schedule(ctx, job.GarbageCollectionVendorType, -1, cronType, cron, job.GarbageCollectionVendorType, policy, extras)
|
||||
}
|
||||
|
||||
|
@ -150,6 +150,7 @@ func (g *gcCtrTestSuite) TestCreateSchedule() {
|
||||
p := Policy{
|
||||
DeleteUntagged: true,
|
||||
ExtraAttrs: dataMap,
|
||||
Workers: 3,
|
||||
}
|
||||
id, err := g.ctl.CreateSchedule(nil, "Daily", "* * * * * *", p)
|
||||
g.Nil(err)
|
||||
|
Loading…
Reference in New Issue
Block a user