mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-15 06:56:36 +00:00
common: Fix bug where aliases might be undefined
Should handle the scenario where the network aliases are undefined. Change-type: patch Signed-off-by: Rich Bayliss <rich@balena.io>
This commit is contained in:
parent
72d715b254
commit
60132134de
@ -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…
x
Reference in New Issue
Block a user