Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
openmole
openmole-connect
Commits
463e4cb3
Commit
463e4cb3
authored
Sep 25, 2019
by
mengxue
Browse files
Add port and path, delete print
parent
d475892e
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/src/main/scala/org/openmole-connect/server/ConnectServlet.scala
View file @
463e4cb3
...
...
@@ -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
.
with
URL
(
podIP
))
action
(
baseForwardRequest
.
with
Host
(
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
())
...
...
server/src/main/scala/org/openmole-connect/server/K8sService.scala
View file @
463e4cb3
...
...
@@ -40,7 +40,6 @@ object K8sService {
podList
map
{
_
.
flatMap
{
pod
:
Pod
=>
println
(
"POD "
+
pod
.
name
)
val
name
=
pod
.
name
val
ns
=
pod
.
namespace
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment