Skip to content

Commit 1f78e40

Browse files
authored
feat: add label to session for anonymous sessions (#1240)
This will allow, for example, to create dedicated network policies that applies specifically to these sessions. The safe username label cannot be used in this context as the label filter does not support regexp expressions.
1 parent b6d149c commit 1f78e40

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

components/renku_data_services/notebooks/core_sessions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,9 @@ async def start_session(
10461046

10471047
labels = {"renku.io/safe-username": user.id}
10481048

1049+
if user.is_anonymous:
1050+
labels["renku.io/anonymous-session"] = "true"
1051+
10491052
session = AmaltheaSessionV1Alpha1(
10501053
metadata=Metadata(name=server_name, annotations=annotations),
10511054
spec=AmaltheaSessionSpec(

0 commit comments

Comments
 (0)