Explorar el Código

Only capture exit codes from `exit` events

Signed-off-by: Laura Brehm <[email protected]>
Laura Brehm hace 3 años
padre
commit
8301dc8314
Se han modificado 1 ficheros con 7 adiciones y 5 borrados
  1. 7 5
      pkg/compose/printer.go

+ 7 - 5
pkg/compose/printer.go

@@ -93,11 +93,13 @@ func (p *printer) Run(ctx context.Context, cascadeStop bool, exitCodeFrom string
 							return 0, err
 						}
 					}
-					if exitCodeFrom == "" {
-						exitCodeFrom = event.Service
-					}
-					if exitCodeFrom == event.Service {
-						exitCode = event.ExitCode
+					if event.Type == api.ContainerEventExit {
+						if exitCodeFrom == "" {
+							exitCodeFrom = event.Service
+						}
+						if exitCodeFrom == event.Service {
+							exitCode = event.ExitCode
+						}
 					}
 				}
 				if len(containers) == 0 {