From 8db9c41ffb875c860639fd59f0bccafb6452fa4a Mon Sep 17 00:00:00 2001 From: Kenan Erdogan Date: Mon, 10 Aug 2020 12:37:49 +0200 Subject: [PATCH 1/3] fix default value of hub_url in config --- helm-chart/binderhub/templates/deployment.yaml | 2 +- helm-chart/images/binderhub/binderhub_config.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/helm-chart/binderhub/templates/deployment.yaml b/helm-chart/binderhub/templates/deployment.yaml index 10bdc4475..5c1bfb7a6 100644 --- a/helm-chart/binderhub/templates/deployment.yaml +++ b/helm-chart/binderhub/templates/deployment.yaml @@ -95,7 +95,7 @@ spec: key: "binder.hub-token" {{- if .Values.config.BinderHub.auth_enabled }} - name: JUPYTERHUB_API_URL - value: {{ (print (.Values.config.BinderHub.hub_url | trimSuffix "/") "/hub/api/") }} + value: {{ print (.Values.config.BinderHub.hub_url | default "" | trimSuffix "/") "/hub/api/" }} - name: JUPYTERHUB_BASE_URL value: {{ .Values.jupyterhub.hub.baseUrl | quote }} - name: JUPYTERHUB_CLIENT_ID diff --git a/helm-chart/images/binderhub/binderhub_config.py b/helm-chart/images/binderhub/binderhub_config.py index 2dd52a4ea..36f96bd1c 100644 --- a/helm-chart/images/binderhub/binderhub_config.py +++ b/helm-chart/images/binderhub/binderhub_config.py @@ -84,7 +84,8 @@ def get_value(key, default=None): c.BinderHub.build_namespace = os.environ['BUILD_NAMESPACE'] if c.BinderHub.auth_enabled: - hub_url = urlparse(c.BinderHub.hub_url) + hub_url = get_value('config.BinderHub.hub_url', '') + hub_url = urlparse(hub_url) c.HubOAuth.hub_host = '{}://{}'.format(hub_url.scheme, hub_url.netloc) if 'base_url' in c.BinderHub: c.HubOAuth.base_url = c.BinderHub.base_url From b45fc6ac8309aca96e8ce50fe213431c44f14317 Mon Sep 17 00:00:00 2001 From: Kenan Erdogan Date: Sun, 30 Aug 2020 16:18:36 +0200 Subject: [PATCH 2/3] Update helm-chart/images/binderhub/binderhub_config.py Co-authored-by: Min RK --- helm-chart/images/binderhub/binderhub_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helm-chart/images/binderhub/binderhub_config.py b/helm-chart/images/binderhub/binderhub_config.py index 36f96bd1c..b52fa425e 100644 --- a/helm-chart/images/binderhub/binderhub_config.py +++ b/helm-chart/images/binderhub/binderhub_config.py @@ -84,9 +84,9 @@ def get_value(key, default=None): c.BinderHub.build_namespace = os.environ['BUILD_NAMESPACE'] if c.BinderHub.auth_enabled: - hub_url = get_value('config.BinderHub.hub_url', '') - hub_url = urlparse(hub_url) - c.HubOAuth.hub_host = '{}://{}'.format(hub_url.scheme, hub_url.netloc) + if "hub_url" in config.BinderHub: + hub_url = urlparse(config.BinderHub. hub_url) + c.HubOAuth.hub_host = '{}://{}'.format(hub_url.scheme, hub_url.netloc) if 'base_url' in c.BinderHub: c.HubOAuth.base_url = c.BinderHub.base_url From 6bc33d6c6170b020dc620a8567aaa23886f6d6e1 Mon Sep 17 00:00:00 2001 From: Kenan Erdogan Date: Sun, 30 Aug 2020 16:19:25 +0200 Subject: [PATCH 3/3] fixes after suggestion --- helm-chart/images/binderhub/binderhub_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm-chart/images/binderhub/binderhub_config.py b/helm-chart/images/binderhub/binderhub_config.py index b52fa425e..390e1ed7f 100644 --- a/helm-chart/images/binderhub/binderhub_config.py +++ b/helm-chart/images/binderhub/binderhub_config.py @@ -84,8 +84,8 @@ def get_value(key, default=None): c.BinderHub.build_namespace = os.environ['BUILD_NAMESPACE'] if c.BinderHub.auth_enabled: - if "hub_url" in config.BinderHub: - hub_url = urlparse(config.BinderHub. hub_url) + if "hub_url" in c.BinderHub: + hub_url = urlparse(c.BinderHub.hub_url) c.HubOAuth.hub_host = '{}://{}'.format(hub_url.scheme, hub_url.netloc) if 'base_url' in c.BinderHub: c.HubOAuth.base_url = c.BinderHub.base_url