From 5a686d2b2b1e528548e1b565ae5861af37c7e831 Mon Sep 17 00:00:00 2001 From: xmik Date: Sun, 6 Dec 2020 16:52:00 +0000 Subject: [PATCH] add workaround for issue #27 --- docker_compose_driver.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker_compose_driver.go b/docker_compose_driver.go index 7c52697..800d017 100644 --- a/docker_compose_driver.go +++ b/docker_compose_driver.go @@ -610,7 +610,13 @@ func (dc DockerComposeDriver) getDCContainersNames(mergedConfig Config, projectN stdout, stderr, exitStatus, _ := dc.ShellService.RunGetOutput(cmd, true) if exitStatus != 0 { cmdInfo := cmdInfoToString(cmd, stdout, stderr, exitStatus) - panic(fmt.Errorf("Unexpected exit status:\n%s", cmdInfo)) + if strings.Contains(stderr, "No such container") { + // Workaround for issue #27: do not panic but print error level log message. + dc.Logger.Log("error", fmt.Sprintf("Unexpected exit status:\n#{cmdInfo}")) + return []string{} + } else { + panic(fmt.Errorf("Unexpected exit status:\n%s", cmdInfo)) + } } stdout = strings.TrimSuffix(stdout, "\n") if stdout == "" {