diff --git a/wait/host_port.go b/wait/host_port.go index af8169cec93..174fdb3ddd1 100644 --- a/wait/host_port.go +++ b/wait/host_port.go @@ -216,9 +216,7 @@ func internalCheck(ctx context.Context, internalPort nat.Port, target StrategyTa // Docker has a issue which override exit code 127 to 126 due to: // https://github.com/moby/moby/issues/45795 // Handle both to ensure compatibility with Docker and Podman for now. - if exitCode == 0 { - break - select exitCode { + switch exitCode { case 0: return nil case exitEaccess: @@ -226,9 +224,7 @@ func internalCheck(ctx context.Context, internalPort nat.Port, target StrategyTa case exitCmdNotFound: return errShellNotFound } - } } - return nil } func buildInternalCheckCommand(internalPort int) string {