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
Léo-Paul Géneau
gitlab-ce
Commits
1e431464
Commit
1e431464
authored
May 28, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move token_in_session to helper method
parent
f7efc5f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/controllers/projects/clusters/gcp_controller.rb
app/controllers/projects/clusters/gcp_controller.rb
+2
-2
app/views/projects/clusters/gcp/_form.html.haml
app/views/projects/clusters/gcp/_form.html.haml
+1
-1
No files found.
app/controllers/projects/clusters/gcp_controller.rb
View file @
1e431464
...
...
@@ -2,6 +2,7 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
before_action
:authorize_read_cluster!
before_action
:authorize_create_cluster!
,
only:
[
:new
,
:create
]
before_action
:authorize_google_api
,
except: :login
helper_method
:token_in_session
def
login
begin
...
...
@@ -59,8 +60,7 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
end
def
token_in_session
@token_in_session
||=
session
[
GoogleApi
::
CloudPlatform
::
Client
.
session_key_for_token
]
session
[
GoogleApi
::
CloudPlatform
::
Client
.
session_key_for_token
]
end
def
expires_at_in_session
...
...
app/views/projects/clusters/gcp/_form.html.haml
View file @
1e431464
...
...
@@ -4,7 +4,7 @@
-
link_to_help_page
=
link_to
(
s_
(
'ClusterIntegration|help page'
),
help_page_path
(
'user/project/clusters/index'
),
target:
'_blank'
,
rel:
'noopener noreferrer'
)
=
s_
(
'ClusterIntegration|Read our %{link_to_help_page} on Kubernetes cluster integration.'
).
html_safe
%
{
link_to_help_page:
link_to_help_page
}
=
form_for
@cluster
,
html:
{
class:
'js-gke-cluster-creation prepend-top-20'
,
data:
{
token:
@
token_in_session
}
},
url:
gcp_namespace_project_clusters_path
(
@project
.
namespace
,
@project
),
as: :cluster
do
|
field
|
=
form_for
@cluster
,
html:
{
class:
'js-gke-cluster-creation prepend-top-20'
,
data:
{
token:
token_in_session
}
},
url:
gcp_namespace_project_clusters_path
(
@project
.
namespace
,
@project
),
as: :cluster
do
|
field
|
=
form_errors
(
@cluster
)
.form-group
=
field
.
label
:name
,
s_
(
'ClusterIntegration|Kubernetes cluster name'
)
...
...
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