Merge branch 'dz-add-project-id-to-jupyter' into 'master'
Add GitLab project id to jupyter config installed via cluster apps See merge request gitlab-org/gitlab-ce!21341
This commit is contained in:
commit
f87809f78d
|
@ -73,10 +73,19 @@ module Clusters
|
|||
"clientSecret" => oauth_application.secret,
|
||||
"callbackUrl" => callback_url
|
||||
}
|
||||
},
|
||||
"singleuser" => {
|
||||
"extraEnv" => {
|
||||
"GITLAB_PROJECT_ID" => project_id
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def project_id
|
||||
cluster&.project&.id
|
||||
end
|
||||
|
||||
def gitlab_url
|
||||
Gitlab.config.gitlab.url
|
||||
end
|
||||
|
|
|
@ -108,8 +108,21 @@ describe Clusters::Applications::Jupyter do
|
|||
expect(values).to include('rbac')
|
||||
expect(values).to include('proxy')
|
||||
expect(values).to include('auth')
|
||||
expect(values).to include('singleuser')
|
||||
expect(values).to match(/clientId: '?#{application.oauth_application.uid}/)
|
||||
expect(values).to match(/callbackUrl: '?#{application.callback_url}/)
|
||||
end
|
||||
|
||||
context 'when cluster belongs to a project' do
|
||||
let(:project) { create(:project) }
|
||||
|
||||
before do
|
||||
application.cluster.projects << project
|
||||
end
|
||||
|
||||
it 'sets GitLab project id' do
|
||||
expect(values).to match(/GITLAB_PROJECT_ID: '?#{project.id}/)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue