diff --git a/api/v2.0/swagger.yaml b/api/v2.0/swagger.yaml index 5f550c794..dd71a37ee 100644 --- a/api/v2.0/swagger.yaml +++ b/api/v2.0/swagger.yaml @@ -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 @@ -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 diff --git a/src/pkg/jobmonitor/model.go b/src/pkg/jobmonitor/model.go index ba3acdef0..8a945507e 100644 --- a/src/pkg/jobmonitor/model.go +++ b/src/pkg/jobmonitor/model.go @@ -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"` } diff --git a/src/server/v2.0/handler/jobservice.go b/src/server/v2.0/handler/jobservice.go index cd6dd5784..92ea66d54 100644 --- a/src/server/v2.0/handler/jobservice.go +++ b/src/server/v2.0/handler/jobservice.go @@ -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" @@ -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, }) @@ -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), }) }