Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
aa15c9fe
Commit
aa15c9fe
authored
Aug 22, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cluster project id to jupyter config
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
f3d9e19b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
app/models/clusters/applications/jupyter.rb
app/models/clusters/applications/jupyter.rb
+9
-0
spec/models/clusters/applications/jupyter_spec.rb
spec/models/clusters/applications/jupyter_spec.rb
+13
-0
No files found.
app/models/clusters/applications/jupyter.rb
View file @
aa15c9fe
...
...
@@ -72,10 +72,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
...
...
spec/models/clusters/applications/jupyter_spec.rb
View file @
aa15c9fe
...
...
@@ -99,8 +99,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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment