fix(apiserver): thread from_host through the CGO conversion layer (bug-1676, gitea #44)
modelJobToSubmit/freeJobSubmit (submit direction) and cJobToModel/cJobArrayToModels (receive direction, both single-job and array-job paths) now carry from_host across the CGO boundary. rawSubmitData/rawJobToModel (the pure-Go, CGO-free mapping layer) gain the field too, completing the round-trip so JobInfo.FromHost reflects whatever the controller actually has -- which, as of the prior two commits, is now always the client-asserted hostname. backend/handler.go needs no change: its existing blind overwrite in OnJobUpdated is correct by construction once every controller push genuinely carries the right value. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AgYRU3zDTqNGV5Jk8aiKLg
This commit is contained in:
parent
363709b032
commit
1a61b04ab6
3 changed files with 28 additions and 0 deletions
|
|
@ -127,6 +127,7 @@ type rawSubmitData struct {
|
|||
minTasks int
|
||||
maxTasks int
|
||||
startInfo *rawStartInfo
|
||||
fromHost string
|
||||
}
|
||||
|
||||
// rawJobData mirrors the C xce_job_t fields used by the Go model.
|
||||
|
|
@ -197,6 +198,7 @@ func rawJobToModel(r rawJobData) *models.JobInfo {
|
|||
info.ResReq = s.resReq
|
||||
info.NumProcessors = s.minTasks
|
||||
info.MaxNumProcessors = s.maxTasks
|
||||
info.FromHost = s.fromHost
|
||||
if s.startInfo != nil {
|
||||
si := s.startInfo
|
||||
info.Command = si.cmdline
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue