summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorAmit Rathi <amit.juschill@gmail.com>2019-05-22 20:16:17 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-05-22 20:16:17 +0000
commit158a14ec202b5001dd84f24a691ae32a8895ca0c (patch)
tree4bb0df40766964add92e079cfde7def117cbd88a /vendor
parent728ddeb6ae3e7112f027696d0d54ddb5375bb907 (diff)
downloadgitlab-ce-158a14ec202b5001dd84f24a691ae32a8895ca0c.tar.gz
JupyterHub Repo Integration
Diffstat (limited to 'vendor')
-rw-r--r--vendor/jupyter/values.yaml20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/jupyter/values.yaml b/vendor/jupyter/values.yaml
index 781d6e3042f..a5e13fdc104 100644
--- a/vendor/jupyter/values.yaml
+++ b/vendor/jupyter/values.yaml
@@ -8,8 +8,28 @@ hub:
extraConfig: |
c.KubeSpawner.cmd = ['jupyter-labhub']
+ async def add_auth_env(spawner):
+ '''
+ We set user's id, login and access token on single user image to
+ enable repository integration for JupyterHub.
+ See: https://gitlab.com/gitlab-org/gitlab-ce/issues/47138#note_154294790
+ '''
+ auth_state = await spawner.user.get_auth_state()
+
+ if not auth_state:
+ spawner.log.warning("No auth state for %s", spawner.user)
+ return
+
+ spawner.environment['GITLAB_ACCESS_TOKEN'] = auth_state['access_token']
+ spawner.environment['GITLAB_USER_LOGIN'] = auth_state['gitlab_user']['username']
+ spawner.environment['GITLAB_USER_ID'] = str(auth_state['gitlab_user']['id'])
+
+ c.KubeSpawner.pre_spawn_hook = add_auth_env
+
auth:
type: gitlab
+ state:
+ enabled: true
singleuser:
defaultUrl: "/lab"