Skip to content

Commit

Permalink
fix gc schedule issue
Browse files Browse the repository at this point in the history
fixes #18881

Save workers settings into the metadata of the garbage collection schedule

Signed-off-by: wang yan <wangyan@vmware.com>
  • Loading branch information
wy65701436 committed Jul 14, 2023
1 parent ff2b99d commit b6b6a7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/controller/gc/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
1 change: 1 addition & 0 deletions src/controller/gc/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b6b6a7b

Please sign in to comment.