소스 검색

Fix bug: exec non-exist command miss a "\n"

When exec a non-exist command, it should print a newline at last.

Currently:
```
$ docker exec -ti f5f703ea2c0a144 bash
rpc error: code = 2 desc = "oci runtime error: exec failed: exec:
\"bash\": executable file not found in $PATH"$
```

Signed-off-by: Feng Yan <fy2462@gmail.com>
fy2462 9 년 전
부모
커밋
8bf5613c1a
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      api/server/router/container/exec.go

+ 2 - 2
api/server/router/container/exec.go

@@ -110,8 +110,8 @@ func (s *containerRouter) postContainerExecStart(ctx context.Context, w http.Res
 		if execStartCheck.Detach {
 		if execStartCheck.Detach {
 			return err
 			return err
 		}
 		}
-		stdout.Write([]byte(err.Error()))
-		logrus.Errorf("Error running exec in container: %v\n", err)
+		stdout.Write([]byte(err.Error() + "\r\n"))
+		logrus.Errorf("Error running exec in container: %v", err)
 	}
 	}
 	return nil
 	return nil
 }
 }