Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab
Commits
70c65e82
Commit
70c65e82
authored
6 years ago
by
Dennis Tang
Browse files
Options
Downloads
Patches
Plain Diff
fix case where token may expire
parent
2532dc74
No related branches found
No related tags found
2 merge requests
!6393
CE upstream - 2018-07-05 12:27 UTC
,
!6387
Prepare 11.1 RC5 EE release
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/projects/clusters_controller.rb
+6
-2
6 additions, 2 deletions
app/controllers/projects/clusters_controller.rb
app/views/projects/clusters/new.html.haml
+1
-1
1 addition, 1 deletion
app/views/projects/clusters/new.html.haml
with
7 additions
and
3 deletions
app/controllers/projects/clusters_controller.rb
+
6
−
2
View file @
70c65e82
...
...
@@ -171,8 +171,7 @@ def generate_gcp_authorize_url
end
def
new_cluster
if
GoogleApi
::
CloudPlatform
::
Client
.
new
(
token_in_session
,
nil
)
.
validate_token
(
expires_at_in_session
)
if
valid_gcp_token
@new_cluster
=
::
Clusters
::
Cluster
.
new
.
tap
do
|
cluster
|
cluster
.
build_provider_gcp
end
...
...
@@ -185,6 +184,11 @@ def existing_cluster
end
end
def
valid_gcp_token
@valid_gcp_token
=
GoogleApi
::
CloudPlatform
::
Client
.
new
(
token_in_session
,
nil
)
.
validate_token
(
expires_at_in_session
)
end
def
token_in_session
@token_in_session
||=
session
[
GoogleApi
::
CloudPlatform
::
Client
.
session_key_for_token
]
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/clusters/new.html.haml
+
1
−
1
View file @
70c65e82
...
...
@@ -20,7 +20,7 @@
.tab-content.gitlab-tab-content
.tab-pane
{
id:
'create-new-cluster-pane'
,
class:
active_when
(
active_tab
==
'new'
),
role:
'tabpanel'
}
=
render
'projects/clusters/gcp/header'
-
if
@
token_in_sessio
n
-
if
@
valid_gcp_toke
n
=
render
'projects/clusters/gcp/form'
-
elsif
@authorize_url
=
link_to
@authorize_url
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment