Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #492 from Microsoft/xiongyf/rest-server-port-fix0
Browse files Browse the repository at this point in the history
[Rest Server] Add default http and ssh port
  • Loading branch information
abuccts committed Apr 18, 2018
2 parents 080d232 + 290446f commit 2e69367
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
13 changes: 1 addition & 12 deletions rest-server/src/config/job.js
Expand Up @@ -67,18 +67,7 @@ const jobConfigSchema = Joi.object().keys({
.default(1),
}))
.optional()
.default([
{
label: 'http',
beginAt: 0,
portNumber: 1,
},
{
label: 'ssh',
beginAt: 0,
portNumber: 1,
},
]),
.default([]),
command: Joi.string()
.required(),
}))
Expand Down
8 changes: 8 additions & 0 deletions rest-server/src/models/job.js
Expand Up @@ -450,6 +450,14 @@ class Job {
'count': data.taskRoles[i].portList[j].portNumber,
};
}
for (let defaultPortLabel of ['http', 'ssh']) {
if (!(defaultPortLabel in portList)) {
portList[defaultPortLabel] = {
'start': 0,
'count': 1,
};
}
}
const taskRole = {
'taskNumber': data.taskRoles[i].taskNumber,
'taskService': {
Expand Down

0 comments on commit 2e69367

Please sign in to comment.