Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jhub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jupyterjsc
k8s
images
jhub
Merge requests
!11
Pass labels to tunnel drf via headers
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Pass labels to tunnel drf via headers
dev
into
main
Overview
0
Commits
13
Pipelines
1
Changes
7
Merged
alice grosch
requested to merge
dev
into
main
2 years ago
Overview
0
Commits
13
Pipelines
1
Changes
7
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
22402d21
13 commits,
2 years ago
7 files
+
27
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
custom/2.1.1/apihandler/spawn_progress.py
+
11
−
0
Options
@@ -110,10 +110,21 @@ class SpawnProgressUpdateAPIHandler(APIHandler):
event
[
"
setup_tunnel
"
][
"
servername
"
]
=
spawner
.
name
event
[
"
setup_tunnel
"
][
"
svc_port
"
]
=
spawner
.
port
event
[
"
setup_tunnel
"
][
"
svc_name
"
]
=
spawner
.
svc_name
labels
=
{
"
hub.jupyter.org/username
"
:
user
.
name
,
"
hub.jupyter.org/servername
"
:
spawner
.
name
,
"
component
"
:
"
singleuser-server
"
,
"
app
"
:
os
.
environ
.
get
(
"
JUPYTERHUB_APP
"
,
"
jupyterhub
"
),
}
for
param
,
value
in
spawner
.
user_options
.
items
():
key
=
f
"
hub.jupyter.org/
{
param
}
"
value
=
value
.
replace
(
'
/
'
,
'
-
'
)
# cannot have '/' in k8s label values
labels
.
update
({
key
:
value
})
custom_config
=
user
.
authenticator
.
custom_config
req_prop
=
drf_request_properties
(
"
tunnel
"
,
custom_config
,
self
.
log
,
uuidcode
)
req_prop
[
"
headers
"
][
"
labels
"
]
=
json
.
dumps
(
labels
)
# Add labels to headers
service_url
=
req_prop
.
get
(
"
urls
"
,
{}).
get
(
"
tunnel
"
,
"
None
"
)
req
=
HTTPRequest
(
service_url
,
Loading