From 76e0361b0e52530472c1af0316ab33bd6aa43f2f Mon Sep 17 00:00:00 2001 From: Cameron Diver Date: Fri, 3 May 2019 11:31:13 +0100 Subject: [PATCH] Fix dockerode type failures Signed-off-by: Cameron Diver --- src/compose/service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compose/service.ts b/src/compose/service.ts index 6ab54089..dd68c8e7 100644 --- a/src/compose/service.ts +++ b/src/compose/service.ts @@ -448,7 +448,7 @@ export class Service { // We cannot use || for this value, as the empty string is a // valid restart policy but will equate to null in an OR - let restart = (container.HostConfig.RestartPolicy || {}).Name; + let restart = _.get(container.HostConfig.RestartPolicy, 'Name'); if (restart == null) { restart = 'always'; } @@ -462,7 +462,9 @@ export class Service { // the entire ContainerInspectInfo object, or upstream the extra // fields to DefinitelyTyped svc.config = { - networkMode: container.HostConfig.NetworkMode, + // The typings say that this is optional, but it's + // always set by docker + networkMode: container.HostConfig.NetworkMode!, portMaps, expose,