From 6e87f00e7339242aafa96a8892a229331c02a06f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jarom=C3=ADr=20Hradil?= <jaromir.hradil@cesnet.cz>
Date: Mon, 7 Oct 2024 16:01:47 +0200
Subject: [PATCH] Fixing RTC mode enabling check + adding RTC extension lock

---
 cesnet-central/deployments/fullhub.yaml | 3 ++-
 common/deployments/hub-production.yaml  | 3 ++-
 common/deployments/hub-staging.yaml     | 3 ++-
 testing/deployments/hub.yaml            | 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/cesnet-central/deployments/fullhub.yaml b/cesnet-central/deployments/fullhub.yaml
index 3ccc80d..b3ff7e3 100644
--- a/cesnet-central/deployments/fullhub.yaml
+++ b/cesnet-central/deployments/fullhub.yaml
@@ -152,8 +152,9 @@ singleuser:
 
         # Disables RTC extension. To enable it set this env variable in kubespawner_override
         # to JUPYTERHUB_ALLOW_TOKEN_IN_URL="1"
-        if [ -z JUPYTERHUB_ALLOW_TOKEN_IN_URL ]; then
+        if [ -z "$JUPYTERHUB_ALLOW_TOKEN_IN_URL" ]; then
           jupyter-labextension  disable @jupyter/collaboration-extension
+          jupyter-labextension lock @jupyter/collaboration-extension
         fi
 
         cd .
diff --git a/common/deployments/hub-production.yaml b/common/deployments/hub-production.yaml
index d3d50ce..1d90b1c 100644
--- a/common/deployments/hub-production.yaml
+++ b/common/deployments/hub-production.yaml
@@ -134,8 +134,9 @@ singleuser:
 
         # Disables RTC extension. To enable it set this env variable in kubespawner_override
         # to JUPYTERHUB_ALLOW_TOKEN_IN_URL="1"
-        if [ -z JUPYTERHUB_ALLOW_TOKEN_IN_URL ]; then
+        if [ -z "$JUPYTERHUB_ALLOW_TOKEN_IN_URL" ]; then
           jupyter-labextension  disable @jupyter/collaboration-extension
+          jupyter-labextension lock @jupyter/collaboration-extension
         fi
 
         cd .
diff --git a/common/deployments/hub-staging.yaml b/common/deployments/hub-staging.yaml
index 42ecb45..0e22e4d 100644
--- a/common/deployments/hub-staging.yaml
+++ b/common/deployments/hub-staging.yaml
@@ -134,8 +134,9 @@ singleuser:
 
         # Disables RTC extension. To enable it set this env variable in kubespawner_override
         # to JUPYTERHUB_ALLOW_TOKEN_IN_URL="1"
-        if [ -z JUPYTERHUB_ALLOW_TOKEN_IN_URL ]; then
+        if [ -z "$JUPYTERHUB_ALLOW_TOKEN_IN_URL" ]; then
           jupyter-labextension  disable @jupyter/collaboration-extension
+          jupyter-labextension lock @jupyter/collaboration-extension
         fi
 
         cd .
diff --git a/testing/deployments/hub.yaml b/testing/deployments/hub.yaml
index 2e4b3b5..08aa541 100644
--- a/testing/deployments/hub.yaml
+++ b/testing/deployments/hub.yaml
@@ -135,8 +135,9 @@ singleuser:
 
         # Disables RTC extension. To enable it set this env variable in kubespawner_override
         # to JUPYTERHUB_ALLOW_TOKEN_IN_URL="1"
-         if [ -z JUPYTERHUB_ALLOW_TOKEN_IN_URL ]; then
+        if [ -z "$JUPYTERHUB_ALLOW_TOKEN_IN_URL" ]; then
           jupyter-labextension  disable @jupyter/collaboration-extension
+          jupyter-labextension lock @jupyter/collaboration-extension
         fi
 
         cd .
-- 
GitLab