mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-23 23:42:29 +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
|
||||
// well-defined (and implemented in a seperate module)
|
||||
const svcCopy = _.cloneDeep(svc);
|
||||
|
||||
_.each(svcCopy.config.networks, (net) => {
|
||||
net.aliases = net.aliases.filter(
|
||||
(alias) => alias !== containerIdForService[svcCopy.serviceName],
|
||||
);
|
||||
if (Array.isArray(net.aliases)) {
|
||||
net.aliases = net.aliases.filter(
|
||||
(alias) => alias !== containerIdForService[svcCopy.serviceName],
|
||||
);
|
||||
}
|
||||
});
|
||||
return svcCopy;
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user