Commit 463e4cb3 authored by mengxue's avatar mengxue
Browse files

Add port and path, delete print

parent d475892e
......@@ -60,7 +60,7 @@ class ConnectServlet(arguments: ConnectServer.ServletArguments) extends Scalatra
def withForwardRequest(uuid: UUID)(action: HttpRequest=> ActionResult): Option[ActionResult] = {
K8sService.podIP(uuid).map { podIP =>
action(baseForwardRequest.withURL(podIP))
action(baseForwardRequest.withHost(podIP).withPort(80).withPath(""))
}
}
......@@ -89,7 +89,6 @@ class ConnectServlet(arguments: ConnectServer.ServletArguments) extends Scalatra
def connectionAppRedirection = {
withAccesToken { tokenData =>
println("UP ??" + K8sService.isServiceUp(tokenData.uuid))
proxyRequest(tokenData.uuid)
}
}
......@@ -173,7 +172,7 @@ class ConnectServlet(arguments: ConnectServer.ServletArguments) extends Scalatra
withForwardRequest(tokenData.uuid) { forwardRequest =>
Ok(
waitForGet(
forwardRequest.withHeader("Content-Type", requestContentType).withPath(s"/${tokenData.uuid.value}/$path")
forwardRequest.withHeader("Content-Type", requestContentType).withPath(s"$path")
).body
)
}.getOrElse(NotFound())
......
......@@ -40,7 +40,6 @@ object K8sService {
podList map {
_.flatMap {
pod: Pod =>
println("POD " + pod.name)
val name = pod.name
val ns = pod.namespace
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment