mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-12 07:52:55 +00:00
Merge pull request #1409 from balena-io/bugfix-safeappclone
common: Fix bug where aliases might be undefined
This commit is contained in:
commit
0b445f4d77
@ -154,10 +154,13 @@ export function safeAppClone(app) {
|
|||||||
// TODO: Make the process of moving from a current state to a target state
|
// TODO: Make the process of moving from a current state to a target state
|
||||||
// well-defined (and implemented in a seperate module)
|
// well-defined (and implemented in a seperate module)
|
||||||
const svcCopy = _.cloneDeep(svc);
|
const svcCopy = _.cloneDeep(svc);
|
||||||
|
|
||||||
_.each(svcCopy.config.networks, (net) => {
|
_.each(svcCopy.config.networks, (net) => {
|
||||||
net.aliases = net.aliases.filter(
|
if (Array.isArray(net.aliases)) {
|
||||||
(alias) => alias !== containerIdForService[svcCopy.serviceName],
|
net.aliases = net.aliases.filter(
|
||||||
);
|
(alias) => alias !== containerIdForService[svcCopy.serviceName],
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return svcCopy;
|
return svcCopy;
|
||||||
}),
|
}),
|
||||||
|
Loading…
Reference in New Issue
Block a user