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..390e1ed7f 100644 --- a/helm-chart/images/binderhub/binderhub_config.py +++ b/helm-chart/images/binderhub/binderhub_config.py @@ -84,8 +84,9 @@ 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) - c.HubOAuth.hub_host = '{}://{}'.format(hub_url.scheme, hub_url.netloc) + 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