Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Create.go #13

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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