Handle portCount in translatePortBindings
This commit is contained in:
@@ -272,8 +272,9 @@ function translatePortBindings(portBindings, manifest) {
|
||||
|
||||
for (let portName in portBindings) {
|
||||
const portType = portName in tcpPorts ? exports.PORT_TYPE_TCP : exports.PORT_TYPE_UDP;
|
||||
result[portName] = { hostPort: portBindings[portName], type: portType };
|
||||
result[portName] = { hostPort: portBindings[portName], type: portType, portCount: portBindings[portName].portCount || 1 };
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -848,7 +849,7 @@ async function add(id, appStoreId, manifest, subdomain, domain, portBindings, da
|
||||
Object.keys(portBindings).forEach(function (env) {
|
||||
queries.push({
|
||||
query: 'INSERT INTO appPortBindings (environmentVariable, hostPort, type, appId, count) VALUES (?, ?, ?, ?, ?)',
|
||||
args: [ env, portBindings[env].hostPort, portBindings[env].type, id, portBindings[env].portCount || 1 ]
|
||||
args: [ env, portBindings[env].hostPort, portBindings[env].type, id, portBindings[env].portCount ]
|
||||
});
|
||||
});
|
||||
|
||||
@@ -919,7 +920,7 @@ async function updateWithConstraints(id, app, constraints) {
|
||||
// replace entries by app id
|
||||
queries.push({ query: 'DELETE FROM appPortBindings WHERE appId = ?', args: [ id ] });
|
||||
Object.keys(portBindings).forEach(function (env) {
|
||||
const values = [ portBindings[env].hostPort, portBindings[env].type, env, id, portBindings[env].portCount || 1 ];
|
||||
const values = [ portBindings[env].hostPort, portBindings[env].type, env, id, portBindings[env].portCount ];
|
||||
queries.push({ query: 'INSERT INTO appPortBindings (hostPort, type, environmentVariable, appId, count) VALUES(?, ?, ?, ?, ?)', args: values });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user