zyratlo commented on code in PR #8073:
URL: https://github.com/apache/texera/pull/8073#discussion_r3962064937
##########
notebook-migration-service/src/main/scala/org/apache/texera/service/util/JupyterKubernetesClient.scala:
##########
@@ -43,6 +43,13 @@ class JupyterKubernetesClient(client:
io.fabric8.kubernetes.client.KubernetesCli
def generatePodURI(uid: Int): String =
s"${generatePodName(uid)}.${KubernetesConfig.jupyterServiceName}.$namespace.svc.cluster.local:${KubernetesConfig.jupyterPortNumber}"
+ /**
+ * Path a user's Jupyter serves under. The uid is in the path because the
browser cannot
+ * present Texera credentials on the requests Jupyter's own scripts make,
so the gateway
+ * has to read the owner out of the URL instead.
+ */
+ def basePathFor(uid: Int): String =
s"${KubernetesConfig.jupyterBaseUrl.stripSuffix("/")}/$uid"
+
Review Comment:
Fixed in 300c30074. basePathFor now strips both ends and prefixes exactly
one slash, so a bare value no longer yields "host:8888jupyter/7" or a
non-absolute JUPYTER_BASE_URL. The chart needed the same treatment separately,
since it assembles the public URL template itself and that string never passes
through Scala; a texera.jupyter.basePath helper now normalises all four places
the value is read. Verified on a cluster with basePath set to "jupyter": the
recorded address, the pod's base_url, the iframe URL and the gateway route all
come out correct.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]