Skip to content

Commit

Permalink
Merge pull request #13 from dciangot/main
Browse files Browse the repository at this point in the history
Fix Create.go
  • Loading branch information
dciangot authored Jul 5, 2024
2 parents c716fe0 + dfa2e61 commit 72cd18c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/slurm/Create.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,23 @@ func (h *SidecarHandler) SubmitHandler(w http.ResponseWriter, r *http.Request) {
return
}

var data commonIL.RetrievedPodData
// TODO: fix interlink to send single request, no 1 item-long lists
var dataList []commonIL.RetrievedPodData

//to be changed to commonIL.CreateStruct
var returnedJID CreateStruct //returnValue
var returnedJIDBytes []byte
err = json.Unmarshal(bodyBytes, &data)
err = json.Unmarshal(bodyBytes, &dataList)
if err != nil {
statusCode = http.StatusInternalServerError
h.handleError(w, statusCode, err)
w.WriteHeader(statusCode)
w.Write([]byte("Some errors occurred while creating container. Check Slurm Sidecar's logs"))
log.G(h.Ctx).Error(err)
return
}

data := dataList[0]

containers := data.Pod.Spec.InitContainers
containers = append(containers, data.Pod.Spec.Containers...)
metadata := data.Pod.ObjectMeta
Expand Down

0 comments on commit 72cd18c

Please sign in to comment.