Skip to content

Commit

Permalink
Remove job parameters and schedule extra attribute (#17878)
Browse files Browse the repository at this point in the history
Remove job parameters from job

  Remove extra attribute and cron type from schedule
  fixes #17866

Signed-off-by: stonezdj <[email protected]>

Signed-off-by: stonezdj <[email protected]>
  • Loading branch information
stonezdj authored Nov 28, 2022
1 parent 80999f2 commit 402363d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
9 changes: 0 additions & 9 deletions api/v2.0/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9447,9 +9447,6 @@ definitions:
description: The start time of the worker
x-nullable: true
x-omitempty: true
args:
type: string
description: The args of the worker
check_in:
type: string
description: the checkin of the running job in the worker
Expand Down Expand Up @@ -9503,12 +9500,6 @@ definitions:
cron:
type: string
description: the cron of the current schedule task
cron_type:
type: string
description: the cron type of the current schedule task
extra_attrs:
type: string
description: the extra attributes
update_time:
type: string
format: date-time
Expand Down
1 change: 0 additions & 1 deletion src/pkg/jobmonitor/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type Worker struct {
JobName string `json:"job_name"`
JobID string `json:"job_id"`
StartedAt int64 `json:"start_at"`
Args string `json:"args"`
CheckIn string `json:"check_in"`
CheckInAt int64 `json:"check_in_at"`
}
Expand Down
14 changes: 0 additions & 14 deletions src/server/v2.0/handler/jobservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ package handler

import (
"context"
"encoding/json"
"fmt"
"strings"
"time"

"github.com/goharbor/harbor/src/lib/errors"
"github.com/goharbor/harbor/src/lib/log"
"github.com/goharbor/harbor/src/pkg/scheduler"

"github.com/go-openapi/runtime/middleware"
Expand Down Expand Up @@ -100,7 +98,6 @@ func toWorkerResponse(wks []*jm.Worker) []*models.Worker {
JobName: w.JobName,
JobID: w.JobID,
PoolID: w.PoolID,
Args: w.Args,
StartAt: startAtTime,
CheckinAt: checkInAtTime,
})
Expand Down Expand Up @@ -135,22 +132,11 @@ func covertTime(t int64) strfmt.DateTime {
func toScheduleResponse(schs []*scheduler.Schedule) []*models.ScheduleTask {
result := make([]*models.ScheduleTask, 0)
for _, s := range schs {
extraAttr := []byte("")
if s.ExtraAttrs != nil {
extra, err := json.Marshal(s.ExtraAttrs)
if err != nil {
log.Warningf("failed to extract extra attribute, error %v", err)
} else {
extraAttr = extra
}
}
result = append(result, &models.ScheduleTask{
ID: s.ID,
VendorType: s.VendorType,
VendorID: s.VendorID,
ExtraAttrs: string(extraAttr),
Cron: s.CRON,
CronType: s.CRONType,
UpdateTime: strfmt.DateTime(s.UpdateTime),
})
}
Expand Down

0 comments on commit 402363d

Please sign in to comment.