diff --git a/entrypoint.sh b/entrypoint.sh index e218f248..d9f95ce9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -41,4 +41,5 @@ env | grep _ >> /etc/environment export PATH=$PATH:/opt/conda/bin cp /root/.bashrc ~/.bash_profile +service ssh start jupyter lab --ip=0.0.0.0 --port=3100 --allow-root --NotebookApp.token='' --LabApp.base_url=$PREVIEW_URL --no-browser --debug diff --git a/show_ssh_info/show_ssh_info/handlers.py b/show_ssh_info/show_ssh_info/handlers.py index 3c521612..c426ec30 100644 --- a/show_ssh_info/show_ssh_info/handlers.py +++ b/show_ssh_info/show_ssh_info/handlers.py @@ -88,6 +88,7 @@ def get(self): host = os.environ.get('KUBERNETES_SERVICE_HOST') host_port = os.environ.get('KUBERNETES_PORT_443_TCP_PORT') workspace_id = os.environ.get('CHE_WORKSPACE_ID') + namespace = os.environ.get('CHE_WORKSPACE_NAMESPACE') with open ("/var/run/secrets/kubernetes.io/serviceaccount/token", "r") as t: token=t.read() @@ -96,7 +97,7 @@ def get(self): 'Authorization': 'Bearer ' + token, } - request_string = 'https://' + host + ':' + host_port + '/api/v1/namespaces/' + workspace_id + '/services/ws' + request_string = 'https://' + host + ':' + host_port + '/api/v1/namespaces/' + namespace + '-' + workspace_id + '/services/ws' response = requests.get(request_string, headers=headers, verify=False) data = response.json()