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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ef65a887
Commit
ef65a887
authored
Nov 20, 2019
by
Tiger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update external link to provider in cluster settings
https://gitlab.com/gitlab-org/gitlab/merge_requests/20425
parent
25df3e13
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
10 deletions
+61
-10
app/presenters/clusters/cluster_presenter.rb
app/presenters/clusters/cluster_presenter.rb
+14
-2
app/views/clusters/clusters/_advanced_settings.html.haml
app/views/clusters/clusters/_advanced_settings.html.haml
+3
-3
changelogs/unreleased/22392-update-cluster-settings-provider-link.yml
...nreleased/22392-update-cluster-settings-provider-link.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+4
-1
spec/presenters/clusters/cluster_presenter_spec.rb
spec/presenters/clusters/cluster_presenter_spec.rb
+35
-4
No files found.
app/presenters/clusters/cluster_presenter.rb
View file @
ef65a887
...
@@ -18,8 +18,20 @@ module Clusters
...
@@ -18,8 +18,20 @@ module Clusters
end
end
end
end
def
gke_cluster_url
def
provider_label
"https://console.cloud.google.com/kubernetes/clusters/details/
#{
provider
.
zone
}
/
#{
name
}
"
if
gcp?
if
aws?
s_
(
'ClusterIntegration|Elastic Kubernetes Service'
)
elsif
gcp?
s_
(
'ClusterIntegration|Google Kubernetes Engine'
)
end
end
def
provider_management_url
if
aws?
"https://console.aws.amazon.com/eks/home?region=
#{
provider
.
region
}
\#
/clusters/
#{
name
}
"
elsif
gcp?
"https://console.cloud.google.com/kubernetes/clusters/details/
#{
provider
.
zone
}
/
#{
name
}
"
end
end
end
def
can_read_cluster?
def
can_read_cluster?
...
...
app/views/clusters/clusters/_advanced_settings.html.haml
View file @
ef65a887
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
-
unless
@cluster
.
provided_by_user?
-
unless
@cluster
.
provided_by_user?
.append-bottom-20
.append-bottom-20
%label
.append-bottom-10
%label
.append-bottom-10
=
s_
(
'ClusterIntegration|Google Kubernetes Engine'
)
=
@cluster
.
provider_label
%p
%p
-
link_gke
=
link_to
(
s_
(
'ClusterIntegration|Google Kubernetes Engine'
),
@cluster
.
gke_cluster
_url
,
target:
'_blank'
,
rel:
'noopener noreferrer'
)
-
provider_link
=
link_to
(
@cluster
.
provider_label
,
@cluster
.
provider_management
_url
,
target:
'_blank'
,
rel:
'noopener noreferrer'
)
=
s_
(
'ClusterIntegration|Manage your Kubernetes cluster by visiting %{
link_gke}'
).
html_safe
%
{
link_gke:
link_gke
}
=
s_
(
'ClusterIntegration|Manage your Kubernetes cluster by visiting %{
provider_link}'
).
html_safe
%
{
provider_link:
provider_link
}
=
form_for
@cluster
,
url:
clusterable
.
cluster_path
(
@cluster
),
as: :cluster
,
html:
{
class:
'cluster_management_form'
}
do
|
field
|
=
form_for
@cluster
,
url:
clusterable
.
cluster_path
(
@cluster
),
as: :cluster
,
html:
{
class:
'cluster_management_form'
}
do
|
field
|
...
...
changelogs/unreleased/22392-update-cluster-settings-provider-link.yml
0 → 100644
View file @
ef65a887
---
title
:
Update external link to provider in cluster settings
merge_request
:
20425
author
:
type
:
fixed
locale/gitlab.pot
View file @
ef65a887
...
@@ -3661,6 +3661,9 @@ msgstr ""
...
@@ -3661,6 +3661,9 @@ msgstr ""
msgid "ClusterIntegration|Did you know?"
msgid "ClusterIntegration|Did you know?"
msgstr ""
msgstr ""
msgid "ClusterIntegration|Elastic Kubernetes Service"
msgstr ""
msgid "ClusterIntegration|Elastic Stack"
msgid "ClusterIntegration|Elastic Stack"
msgstr ""
msgstr ""
...
@@ -3892,7 +3895,7 @@ msgstr ""
...
@@ -3892,7 +3895,7 @@ msgstr ""
msgid "ClusterIntegration|Make sure your account %{link_to_requirements} to create Kubernetes clusters"
msgid "ClusterIntegration|Make sure your account %{link_to_requirements} to create Kubernetes clusters"
msgstr ""
msgstr ""
msgid "ClusterIntegration|Manage your Kubernetes cluster by visiting %{
link_gke
}"
msgid "ClusterIntegration|Manage your Kubernetes cluster by visiting %{
provider_link
}"
msgstr ""
msgstr ""
msgid "ClusterIntegration|No IAM Roles found"
msgid "ClusterIntegration|No IAM Roles found"
...
...
spec/presenters/clusters/cluster_presenter_spec.rb
View file @
ef65a887
...
@@ -153,11 +153,42 @@ describe Clusters::ClusterPresenter do
...
@@ -153,11 +153,42 @@ describe Clusters::ClusterPresenter do
end
end
end
end
describe
'#
gke_cluster_ur
l'
do
describe
'#
provider_labe
l'
do
subject
{
described_class
.
new
(
cluster
).
gke_cluster_url
}
let
(
:cluster
)
{
create
(
:cluster
,
provider_type:
provider_type
)
}
it
{
is_expected
.
to
include
(
cluster
.
provider
.
zone
)
}
subject
{
described_class
.
new
(
cluster
).
provider_label
}
it
{
is_expected
.
to
include
(
cluster
.
name
)
}
context
'AWS provider'
do
let
(
:provider_type
)
{
:aws
}
it
{
is_expected
.
to
eq
(
'Elastic Kubernetes Service'
)
}
end
context
'GCP provider'
do
let
(
:provider_type
)
{
:gcp
}
it
{
is_expected
.
to
eq
(
'Google Kubernetes Engine'
)
}
end
end
describe
'#provider_management_url'
do
let
(
:cluster
)
{
provider
.
cluster
}
subject
{
described_class
.
new
(
cluster
).
provider_management_url
}
context
'AWS provider'
do
let
(
:provider
)
{
create
(
:cluster_provider_aws
)
}
it
{
is_expected
.
to
include
(
provider
.
region
)
}
it
{
is_expected
.
to
include
(
cluster
.
name
)
}
end
context
'GCP provider'
do
let
(
:provider
)
{
create
(
:cluster_provider_gcp
)
}
it
{
is_expected
.
to
include
(
provider
.
zone
)
}
it
{
is_expected
.
to
include
(
cluster
.
name
)
}
end
end
end
describe
'#cluster_type_description'
do
describe
'#cluster_type_description'
do
...
...
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