fix(apiserver): jobs list -l/-o validates against the wrong struct (bug-1674, gitea #41)
GetJobsInfo/GetJobByIDs validated the -o/-l field list against
models.JobSubmitRequest{} -- the job-submission payload -- instead of
models.JobInfo{}, the query/response model (the already-correct
pattern used elsewhere in this file at line 1131). Response-only
fields like pending_reason don't exist on JobSubmitRequest, so any
such field made the whole listing fail outright with "unsupported
query field", not just omit that column.
core_limit/mem_limit exist on JobSubmitRequest but not on JobInfo --
switching wholesale would have newly broken those two previously-valid
fields. Added CoreLimit/MemLimit to JobAdditionalFields, the existing
merge-in bucket already used for pids/pgids/interactive_job_url.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgYRU3zDTqNGV5Jk8aiKLg
This commit is contained in:
parent
643741fad5
commit
88c7c05daf
3 changed files with 54 additions and 2 deletions
|
|
@ -550,7 +550,7 @@ func (j JobController) GetJobsInfo(ctx *gin.Context) {
|
|||
found2 := false
|
||||
found3 := false
|
||||
// verify the fields is in supported list
|
||||
supportedFields := utils.GetSupportedFields(models.JobSubmitRequest{})
|
||||
supportedFields := utils.GetSupportedFields(models.JobInfo{})
|
||||
|
||||
utils.AddFieldsToSupportedList(&supportedFields, models.JobAdditionalFields{})
|
||||
logger.Debug("job supportedFields: %v", zap.Any("supportedFields", supportedFields))
|
||||
|
|
@ -898,7 +898,7 @@ func (j JobController) GetJobByIDs(ctx *gin.Context) {
|
|||
found1 := false
|
||||
found2 := false
|
||||
// verify the fields is in supported list
|
||||
supportedFields := utils.GetSupportedFields(models.JobSubmitRequest{})
|
||||
supportedFields := utils.GetSupportedFields(models.JobInfo{})
|
||||
utils.AddFieldsToSupportedList(&supportedFields, models.JobAdditionalFields{})
|
||||
logger.Debug("job supportedFields: %v", zap.Any("supportedFields", supportedFields))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue