Skip to content
Open
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
19 changes: 17 additions & 2 deletions src/controllers/sessions.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ export class SessionsController {
session: Session,
): Promise<Session> {
let type = session.type
var deleteJobConfig = {
method: 'delete',
url: 'https://51.138.70.243/apis/batch/v1/namespaces/pumba/jobs/validator-' + type + '-' + session.sid,
headers: {
'Authorization': process.env.K8STOKEN,
'Content-Type': 'application/json'
}
}
await axios(deleteJobConfig)
.then((response: any) => {
console.log(response.status);
})
.catch((error: any) => {
console.log(error.response.data.message);
});
let data = {
"apiVersion": "batch/v1",
"kind": "Job",
Expand All @@ -67,7 +82,7 @@ export class SessionsController {
}
}
}
var config = {
var createJobConfig = {
method: 'post',
url: 'https://51.138.70.243/apis/batch/v1/namespaces/pumba/jobs',
headers: {
Expand All @@ -76,7 +91,7 @@ export class SessionsController {
},
data : data
};
await axios(config)
await axios(createJobConfig)
.then((response: any) => {
console.log(response.status);
})
Expand Down