Commit f7e28d26 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'dz-expose-cluster-id-to-jupyter' into 'master'

Add GitLab cluster id to jupyter config

Closes #51474 and #51594

See merge request gitlab-org/gitlab-ce!21796
parents 3fe6f2ce 02129c29
...@@ -73,6 +73,11 @@ module Clusters ...@@ -73,6 +73,11 @@ module Clusters
"clientSecret" => oauth_application.secret, "clientSecret" => oauth_application.secret,
"callbackUrl" => callback_url "callbackUrl" => callback_url
} }
},
"singleuser" => {
"extraEnv" => {
"GITLAB_CLUSTER_ID" => cluster.id
}
} }
} }
end end
......
...@@ -108,8 +108,15 @@ describe Clusters::Applications::Jupyter do ...@@ -108,8 +108,15 @@ describe Clusters::Applications::Jupyter do
expect(values).to include('rbac') expect(values).to include('rbac')
expect(values).to include('proxy') expect(values).to include('proxy')
expect(values).to include('auth') expect(values).to include('auth')
expect(values).to include('singleuser')
expect(values).to match(/clientId: '?#{application.oauth_application.uid}/) expect(values).to match(/clientId: '?#{application.oauth_application.uid}/)
expect(values).to match(/callbackUrl: '?#{application.callback_url}/) expect(values).to match(/callbackUrl: '?#{application.callback_url}/)
end end
context 'when cluster belongs to a project' do
it 'sets GitLab project id' do
expect(values).to match(/GITLAB_CLUSTER_ID: '?#{application.cluster.id}/)
end
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment