restore: prune portBindings whose tcpPorts/udpPorts no longer exist
fixes #871
This commit is contained in:
@@ -2506,6 +2506,15 @@ async function restore(app, backupId, auditSource) {
|
|||||||
const newHttpPorts = manifest.httpPorts || {};
|
const newHttpPorts = manifest.httpPorts || {};
|
||||||
values.secondaryDomains = app.secondaryDomains.filter(sd => sd.environmentVariable in newHttpPorts);
|
values.secondaryDomains = app.secondaryDomains.filter(sd => sd.environmentVariable in newHttpPorts);
|
||||||
|
|
||||||
|
// prune portBindings whose tcpPorts/udpPorts no longer exist in the restored manifest
|
||||||
|
const newTcpPorts = manifest.tcpPorts || {};
|
||||||
|
const newUdpPorts = manifest.udpPorts || {};
|
||||||
|
const portBindings = {};
|
||||||
|
for (const portName in app.portBindings) {
|
||||||
|
if (portName in newTcpPorts || portName in newUdpPorts) portBindings[portName] = app.portBindings[portName];
|
||||||
|
}
|
||||||
|
values.portBindings = portBindings;
|
||||||
|
|
||||||
const restoreConfig = { backupId: restoreBackup.id };
|
const restoreConfig = { backupId: restoreBackup.id };
|
||||||
|
|
||||||
const task = {
|
const task = {
|
||||||
|
|||||||
Reference in New Issue
Block a user