Commit d6e1b58f authored by Anna Vovchenko's avatar Anna Vovchenko Committed by Enrique Alcántara

Split cluster creation page into two pages

We are changing the cluster creation page from the tabs to the
two separate pages -
new and connect. It should help with the planned deprecations removal.

Changelog: changed
parent 9f49af3c
...@@ -5,9 +5,9 @@ import { s__ } from '~/locale'; ...@@ -5,9 +5,9 @@ import { s__ } from '~/locale';
export default { export default {
i18n: { i18n: {
title: s__('ClusterIntegration|Enter the details for your Kubernetes cluster'), title: s__('ClusterIntegration|Enter your Kubernetes cluster certificate details'),
information: s__( information: s__(
'ClusterIntegration|Please enter access information for your Kubernetes cluster. If you need help, you can read our %{linkStart}documentation%{linkEnd} on Kubernetes', 'ClusterIntegration|Enter details about your cluster. %{linkStart}How do I use a certificate to connect to my cluster?%{linkEnd}',
), ),
}, },
components: { components: {
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
</script> </script>
<template> <template>
<div> <div class="gl-pt-4">
<h4>{{ $options.i18n.title }}</h4> <h4>{{ $options.i18n.title }}</h4>
<p> <p>
<gl-sprintf :message="$options.i18n.information"> <gl-sprintf :message="$options.i18n.information">
......
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
GlSprintf, GlSprintf,
GlAlert, GlAlert,
}, },
inject: ['emptyStateHelpText', 'clustersEmptyStateImage', 'newClusterPath'], inject: ['emptyStateHelpText', 'clustersEmptyStateImage', 'addClusterPath'],
props: { props: {
isChildComponent: { isChildComponent: {
default: false, default: false,
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
category="primary" category="primary"
variant="confirm" variant="confirm"
:disabled="!canAddCluster" :disabled="!canAddCluster"
:href="newClusterPath" :href="addClusterPath"
> >
{{ $options.i18n.buttonText }} {{ $options.i18n.buttonText }}
</gl-button> </gl-button>
......
...@@ -9,9 +9,9 @@ class Clusters::ClustersController < Clusters::BaseController ...@@ -9,9 +9,9 @@ class Clusters::ClustersController < Clusters::BaseController
before_action :generate_gcp_authorize_url, only: [:new] before_action :generate_gcp_authorize_url, only: [:new]
before_action :validate_gcp_token, only: [:new] before_action :validate_gcp_token, only: [:new]
before_action :gcp_cluster, only: [:new] before_action :gcp_cluster, only: [:new]
before_action :user_cluster, only: [:new] before_action :user_cluster, only: [:new, :connect]
before_action :authorize_read_cluster!, only: [:show, :index] before_action :authorize_read_cluster!, only: [:show, :index]
before_action :authorize_create_cluster!, only: [:new, :authorize_aws_role] before_action :authorize_create_cluster!, only: [:new, :connect, :authorize_aws_role]
before_action :authorize_update_cluster!, only: [:update] before_action :authorize_update_cluster!, only: [:update]
before_action :update_applications_status, only: [:cluster_status] before_action :update_applications_status, only: [:cluster_status]
before_action :ensure_feature_enabled!, except: :index before_action :ensure_feature_enabled!, except: :index
...@@ -152,7 +152,7 @@ class Clusters::ClustersController < Clusters::BaseController ...@@ -152,7 +152,7 @@ class Clusters::ClustersController < Clusters::BaseController
validate_gcp_token validate_gcp_token
gcp_cluster gcp_cluster
render :new, locals: { active_tab: 'add' } render :connect
end end
end end
......
# frozen_string_literal: true # frozen_string_literal: true
module ClustersHelper module ClustersHelper
def create_new_cluster_label(provider: nil)
case provider
when 'aws'
s_('ClusterIntegration|Create new cluster on EKS')
when 'gcp'
s_('ClusterIntegration|Create new cluster on GKE')
else
s_('ClusterIntegration|Create new cluster')
end
end
def display_cluster_agents?(clusterable) def display_cluster_agents?(clusterable)
clusterable.is_a?(Project) clusterable.is_a?(Project)
end end
...@@ -27,8 +16,8 @@ module ClustersHelper ...@@ -27,8 +16,8 @@ module ClustersHelper
}, },
clusters_empty_state_image: image_path('illustrations/empty-state/empty-state-clusters.svg'), clusters_empty_state_image: image_path('illustrations/empty-state/empty-state-clusters.svg'),
empty_state_help_text: clusterable.empty_state_help_text, empty_state_help_text: clusterable.empty_state_help_text,
new_cluster_path: clusterable.new_path(tab: 'create'), new_cluster_path: clusterable.new_path,
add_cluster_path: clusterable.new_path(tab: 'add'), add_cluster_path: clusterable.connect_path,
can_add_cluster: clusterable.can_add_cluster?.to_s, can_add_cluster: clusterable.can_add_cluster?.to_s,
can_admin_cluster: clusterable.can_admin_cluster?.to_s, can_admin_cluster: clusterable.can_admin_cluster?.to_s,
display_cluster_agents: display_cluster_agents?(clusterable).to_s, display_cluster_agents: display_cluster_agents?(clusterable).to_s,
......
...@@ -32,6 +32,10 @@ class ClusterablePresenter < Gitlab::View::Presenter::Delegated ...@@ -32,6 +32,10 @@ class ClusterablePresenter < Gitlab::View::Presenter::Delegated
new_polymorphic_path([clusterable, :cluster], options) new_polymorphic_path([clusterable, :cluster], options)
end end
def connect_path
polymorphic_path([clusterable, :clusters], action: :connect)
end
def authorize_aws_role_path def authorize_aws_role_path
polymorphic_path([clusterable, :clusters], action: :authorize_aws_role) polymorphic_path([clusterable, :clusters], action: :authorize_aws_role)
end end
......
...@@ -38,6 +38,11 @@ class InstanceClusterablePresenter < ClusterablePresenter ...@@ -38,6 +38,11 @@ class InstanceClusterablePresenter < ClusterablePresenter
admin_cluster_path(cluster, params) admin_cluster_path(cluster, params)
end end
override :connect_path
def connect_path
connect_admin_clusters_path
end
override :create_user_clusters_path override :create_user_clusters_path
def create_user_clusters_path def create_user_clusters_path
create_user_admin_clusters_path create_user_admin_clusters_path
......
...@@ -22,12 +22,12 @@ class ProjectClusterablePresenter < ClusterablePresenter ...@@ -22,12 +22,12 @@ class ProjectClusterablePresenter < ClusterablePresenter
override :sidebar_text override :sidebar_text
def sidebar_text def sidebar_text
s_('ClusterIntegration|With a Kubernetes cluster associated to this project, you can use review apps, deploy your applications, run your pipelines, and much more in an easy way.') s_('ClusterIntegration|Use GitLab to deploy to your cluster, run jobs, use review apps, and more.')
end end
override :learn_more_link override :learn_more_link
def learn_more_link def learn_more_link
ApplicationController.helpers.link_to(s_('ClusterIntegration|Learn more about Kubernetes'), help_page_path('user/project/clusters/index'), target: '_blank', rel: 'noopener noreferrer') ApplicationController.helpers.link_to(s_('ClusterIntegration|Learn more about Kubernetes.'), help_page_path('user/project/clusters/index'), target: '_blank', rel: 'noopener noreferrer')
end end
def metrics_dashboard_path(cluster) def metrics_dashboard_path(cluster)
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
- help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe - help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe
- help_link_end = '</a>'.html_safe - help_link_end = '</a>'.html_safe
%p %p.gl-font-weight-bold
= s_('ClusterIntegration|If you are setting up multiple clusters and are using Auto DevOps, %{help_link_start}read this first%{help_link_end}.').html_safe % { help_link_start: help_link_start % { url: autodevops_help_url }, help_link_end: help_link_end } = s_('ClusterIntegration|Using AutoDevOps with multiple clusters? %{help_link_start}Read this first.%{help_link_end}').html_safe % { help_link_start: help_link_start % { url: autodevops_help_url }, help_link_end: help_link_end }
%h4.gl-mt-0 %h3
= s_('ClusterIntegration|Add a Kubernetes cluster integration') = s_('ClusterIntegration|Connect a Kubernetes cluster')
%p %p
= clusterable.sidebar_text = clusterable.sidebar_text
%p %p
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
- logo_path = local_assigns.fetch(:logo_path) - logo_path = local_assigns.fetch(:logo_path)
- label = local_assigns.fetch(:label) - label = local_assigns.fetch(:label)
- last = local_assigns.fetch(:last, false) - last = local_assigns.fetch(:last, false)
- classes = ["btn btn-light btn-outline flex-fill d-inline-flex flex-column justify-content-center align-items-center w-50 js-create-#{provider}-cluster-button"] - classes = ["btn btn-confirm gl-button btn-confirm-secondary gl-flex-direction-column gl-w-half js-create-#{provider}-cluster-button"]
- conditional_classes = [('mr-3' unless last), ('active' if is_current_provider)] - conditional_classes = [('gl-mr-5' unless last), ('active' if is_current_provider)]
= link_to clusterable.new_path(provider: provider), class: classes + conditional_classes do = link_to clusterable.new_path(provider: provider), class: classes + conditional_classes do
.svg-content.p-2= image_tag logo_path, alt: label, class: 'gl-w-64 gl-h-64' .svg-content.gl-p-3= image_tag logo_path, alt: label, class: 'gl-w-64 gl-h-64'
%span %span
= label = label
- gke_label = s_('ClusterIntegration|Google GKE') - gke_label = s_('ClusterIntegration|Google GKE')
- eks_label = s_('ClusterIntegration|Amazon EKS') - eks_label = s_('ClusterIntegration|Amazon EKS')
- create_cluster_label = s_('ClusterIntegration|Create cluster on') - create_cluster_label = s_('ClusterIntegration|Where do you want to create a cluster?')
.d-flex.flex-column.p-3 .gl-p-5
%h4.mb-3 %h4.gl-mb-5
= create_cluster_label = create_cluster_label
.d-flex .gl-display-flex
= render partial: 'clusters/clusters/cloud_providers/cloud_provider_button', = render partial: 'clusters/clusters/cloud_providers/cloud_provider_button',
locals: { provider: 'aws', label: eks_label, logo_path: 'illustrations/logos/amazon_eks.svg' } locals: { provider: 'aws', label: eks_label, logo_path: 'illustrations/logos/amazon_eks.svg' }
= render partial: 'clusters/clusters/cloud_providers/cloud_provider_button', = render partial: 'clusters/clusters/cloud_providers/cloud_provider_button',
......
- @content_class = 'limit-container-width' unless fluid_layout
- add_to_breadcrumbs _('Kubernetes Clusters'), clusterable.index_path
- breadcrumb_title _('Connect a cluster')
- page_title _('Connect a Kubernetes Cluster')
.row.gl-mt-3
.col-md-3
= render 'sidebar'
.col-md-9
#js-cluster-new{ data: js_cluster_new }
= render 'clusters/clusters/user/form'
...@@ -67,20 +67,20 @@ ...@@ -67,20 +67,20 @@
label_class: 'label-bold' } label_class: 'label-bold' }
.form-text.text-muted .form-text.text-muted
= s_('ClusterIntegration|Uses the Cloud Run, Istio, and HTTP Load Balancing addons for this cluster.') = s_('ClusterIntegration|Uses the Cloud Run, Istio, and HTTP Load Balancing addons for this cluster.')
= link_to _('More information'), help_page_path('user/project/clusters/add_gke_clusters.md', anchor: 'cloud-run-for-anthos'), target: '_blank', rel: 'noopener noreferrer' = link_to _('Learn more.'), help_page_path('user/project/clusters/add_gke_clusters.md', anchor: 'cloud-run-for-anthos'), target: '_blank', rel: 'noopener noreferrer'
.form-group .form-group
= field.check_box :managed, { label: s_('ClusterIntegration|GitLab-managed cluster'), = field.check_box :managed, { label: s_('ClusterIntegration|GitLab-managed cluster'),
label_class: 'label-bold' } label_class: 'label-bold' }
.form-text.text-muted .form-text.text-muted
= s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.') = s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.')
= link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer' = link_to _('Learn more.'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer'
.form-group .form-group
= field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' } = field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' }
.form-text.text-muted .form-text.text-muted
= s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.') = s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.')
= link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer' = link_to _('Learn more.'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer'
.form-group.js-gke-cluster-creation-submit-container .form-group.js-gke-cluster-creation-submit-container
= field.submit s_('ClusterIntegration|Create Kubernetes cluster'), = field.submit s_('ClusterIntegration|Create Kubernetes cluster'),
......
- breadcrumb_title _('Kubernetes') - @content_class = 'limit-container-width' unless fluid_layout
- page_title _('Kubernetes Cluster') - add_to_breadcrumbs _('Kubernetes Clusters'), clusterable.index_path
- breadcrumb_title _('Create a cluster')
- page_title _('Create a Kubernetes cluster')
- provider = params[:provider] - provider = params[:provider]
- active_tab = params[:tab] || local_assigns.fetch(:active_tab, 'create')
- is_active_tab_create = active_tab === 'create'
- is_active_tab_add = active_tab === 'add'
= render_gcp_signup_offer = render_gcp_signup_offer
...@@ -11,21 +10,8 @@ ...@@ -11,21 +10,8 @@
.col-md-3 .col-md-3
= render 'sidebar' = render 'sidebar'
.col-md-9 .col-md-9
= gl_tabs_nav({ class: 'nav-justified' }) do
= gl_tab_link_to clusterable.new_path(tab: 'create'), { item_active: is_active_tab_create } do
%span= create_new_cluster_label(provider: params[:provider])
= gl_tab_link_to s_('ClusterIntegration|Connect existing cluster'), clusterable.new_path(tab: 'add'), { item_active: is_active_tab_add, qa_selector: 'add_existing_cluster_tab' }
.tab-content
- if is_active_tab_create
.tab-pane.active{ role: 'tabpanel' }
= render 'clusters/clusters/cloud_providers/cloud_provider_selector' = render 'clusters/clusters/cloud_providers/cloud_provider_selector'
- if ['aws', 'gcp'].include?(provider) - if ['aws', 'gcp'].include?(provider)
.p-3.border-top .gl-p-5.gl-border-1.gl-border-t-solid.gl-border-gray-100
= render "clusters/clusters/#{provider}/new" = render "clusters/clusters/#{provider}/new"
- if is_active_tab_add
.tab-pane.active.gl-p-5{ role: 'tabpanel' }
#js-cluster-new{ data: js_cluster_new }
= render 'clusters/clusters/user/form'
- more_info_link = link_to _('More information'), help_page_path('user/project/clusters/add_remove_clusters.md', - more_info_link = link_to _('Learn more.'), help_page_path('user/project/clusters/add_remove_clusters.md',
anchor: 'add-existing-cluster'), target: '_blank', rel: 'noopener noreferrer' anchor: 'add-existing-cluster'), target: '_blank', rel: 'noopener noreferrer'
- rbac_help_link = link_to _('More information'), help_page_path('user/project/clusters/add_remove_clusters.md', - rbac_help_link = link_to _('Learn more.'), help_page_path('user/project/clusters/add_remove_clusters.md',
anchor: 'access-controls'), target: '_blank', rel: 'noopener noreferrer' anchor: 'access-controls'), target: '_blank', rel: 'noopener noreferrer'
- api_url_help_text = s_('ClusterIntegration|The URL used to access the Kubernetes API.') - api_url_help_text = s_('ClusterIntegration|The URL used to access the Kubernetes API.')
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
label_class: 'label-bold' } label_class: 'label-bold' }
.form-text.text-muted .form-text.text-muted
= s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.') = s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.')
= link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer' = link_to _('Learn more.'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer'
.form-group .form-group
= field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' } = field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' }
.form-text.text-muted .form-text.text-muted
= s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.') = s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.')
= link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer' = link_to _('Learn more.'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer'
= field.fields_for :platform_kubernetes, @user_cluster.platform_kubernetes do |platform_kubernetes_field| = field.fields_for :platform_kubernetes, @user_cluster.platform_kubernetes do |platform_kubernetes_field|
- if @user_cluster.allow_user_defined_namespace? - if @user_cluster.allow_user_defined_namespace?
......
...@@ -235,6 +235,7 @@ Rails.application.routes.draw do ...@@ -235,6 +235,7 @@ Rails.application.routes.draw do
concern :clusterable do concern :clusterable do
resources :clusters, only: [:index, :new, :show, :update, :destroy] do resources :clusters, only: [:index, :new, :show, :update, :destroy] do
collection do collection do
get :connect
post :create_user post :create_user
post :create_gcp post :create_gcp
post :create_aws post :create_aws
......
...@@ -76,17 +76,18 @@ to deploy this project to. ...@@ -76,17 +76,18 @@ to deploy this project to.
![Project landing page](img/guide_project_landing_page_v12_10.png) ![Project landing page](img/guide_project_landing_page_v12_10.png)
1. On the **Add a Kubernetes cluster integration** page, select the **Create new cluster** tab, 1. On the **Kubernetes clusters** page, select the **Create a new cluster** option from the **Actions** dropdown menu.
then select **Google GKE**.
1. On the **Connect a Kubernetes cluster** page, select **Google GKE**.
1. Connect with your Google account, and select **Allow** to allow access to your 1. Connect with your Google account, and select **Allow** to allow access to your
Google account. (This authorization request is only displayed the first time Google account. (This authorization request is only displayed the first time
you connect GitLab with your Google account.) you connect GitLab with your Google account.)
After authorizing access, the **Add a Kubernetes cluster integration** page After authorizing access, the **Connect a Kubernetes cluster** page
is displayed. is displayed.
1. In the **Enter the details for your Kubernetes cluster** section, provide 1. In the **Enter your Kubernetes cluster certificate details** section, provide
details about your cluster: details about your cluster:
- **Kubernetes cluster name** - **Kubernetes cluster name**
......
...@@ -69,8 +69,8 @@ To add a Kubernetes cluster to your project, group, or instance: ...@@ -69,8 +69,8 @@ To add a Kubernetes cluster to your project, group, or instance:
1. Project's **{cloud-gear}** **Infrastructure > Kubernetes clusters** page, for a project-level cluster. 1. Project's **{cloud-gear}** **Infrastructure > Kubernetes clusters** page, for a project-level cluster.
1. Group's **{cloud-gear}** **Kubernetes** page, for a group-level cluster. 1. Group's **{cloud-gear}** **Kubernetes** page, for a group-level cluster.
1. **Menu > Admin > Kubernetes** page, for an instance-level cluster. 1. **Menu > Admin > Kubernetes** page, for an instance-level cluster.
1. Click **Add Kubernetes cluster**. 1. On the **Kubernetes clusters** page, select the **Connect with a certificate** option from the **Actions** dropdown menu.
1. Click the **Add existing cluster** tab and fill in the details: 1. On the **Connect a cluster** page, fill in the details:
1. **Kubernetes cluster name** (required) - The name you wish to give the cluster. 1. **Kubernetes cluster name** (required) - The name you wish to give the cluster.
1. **Environment scope** (required) - The 1. **Environment scope** (required) - The
[associated environment](multiple_kubernetes_clusters.md#setting-the-environment-scope) to this cluster. [associated environment](multiple_kubernetes_clusters.md#setting-the-environment-scope) to this cluster.
......
...@@ -7960,9 +7960,6 @@ msgstr "" ...@@ -7960,9 +7960,6 @@ msgstr ""
msgid "ClusterIntegration|Add Kubernetes cluster" msgid "ClusterIntegration|Add Kubernetes cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|Add a Kubernetes cluster integration"
msgstr ""
msgid "ClusterIntegration|Adding a Kubernetes cluster to your group will automatically share the cluster across all your projects. Use review apps, deploy your applications, and easily run your pipelines for all projects using the same cluster." msgid "ClusterIntegration|Adding a Kubernetes cluster to your group will automatically share the cluster across all your projects. Use review apps, deploy your applications, and easily run your pipelines for all projects using the same cluster."
msgstr "" msgstr ""
...@@ -8071,7 +8068,7 @@ msgstr "" ...@@ -8071,7 +8068,7 @@ msgstr ""
msgid "ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters. %{linkStart}More information%{linkEnd}" msgid "ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters. %{linkStart}More information%{linkEnd}"
msgstr "" msgstr ""
msgid "ClusterIntegration|Connect existing cluster" msgid "ClusterIntegration|Connect a Kubernetes cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|Connect with a certificate" msgid "ClusterIntegration|Connect with a certificate"
...@@ -8119,18 +8116,6 @@ msgstr "" ...@@ -8119,18 +8116,6 @@ msgstr ""
msgid "ClusterIntegration|Create Kubernetes cluster" msgid "ClusterIntegration|Create Kubernetes cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|Create cluster on"
msgstr ""
msgid "ClusterIntegration|Create new cluster"
msgstr ""
msgid "ClusterIntegration|Create new cluster on EKS"
msgstr ""
msgid "ClusterIntegration|Create new cluster on GKE"
msgstr ""
msgid "ClusterIntegration|Creating Kubernetes cluster" msgid "ClusterIntegration|Creating Kubernetes cluster"
msgstr "" msgstr ""
...@@ -8164,6 +8149,9 @@ msgstr "" ...@@ -8164,6 +8149,9 @@ msgstr ""
msgid "ClusterIntegration|Enable this setting if using role-based access control (RBAC)." msgid "ClusterIntegration|Enable this setting if using role-based access control (RBAC)."
msgstr "" msgstr ""
msgid "ClusterIntegration|Enter details about your cluster. %{linkStart}How do I use a certificate to connect to my cluster?%{linkEnd}"
msgstr ""
msgid "ClusterIntegration|Enter new Service Token" msgid "ClusterIntegration|Enter new Service Token"
msgstr "" msgstr ""
...@@ -8173,6 +8161,9 @@ msgstr "" ...@@ -8173,6 +8161,9 @@ msgstr ""
msgid "ClusterIntegration|Enter the details for your Kubernetes cluster" msgid "ClusterIntegration|Enter the details for your Kubernetes cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|Enter your Kubernetes cluster certificate details"
msgstr ""
msgid "ClusterIntegration|Environment scope" msgid "ClusterIntegration|Environment scope"
msgstr "" msgstr ""
...@@ -8236,9 +8227,6 @@ msgstr "" ...@@ -8236,9 +8227,6 @@ msgstr ""
msgid "ClusterIntegration|HTTP Error" msgid "ClusterIntegration|HTTP Error"
msgstr "" msgstr ""
msgid "ClusterIntegration|If you are setting up multiple clusters and are using Auto DevOps, %{help_link_start}read this first%{help_link_end}."
msgstr ""
msgid "ClusterIntegration|If you do not wish to delete all associated GitLab resources, you can simply remove the integration." msgid "ClusterIntegration|If you do not wish to delete all associated GitLab resources, you can simply remove the integration."
msgstr "" msgstr ""
...@@ -8284,7 +8272,7 @@ msgstr "" ...@@ -8284,7 +8272,7 @@ msgstr ""
msgid "ClusterIntegration|Learn more about %{help_link_start}zones%{help_link_end}." msgid "ClusterIntegration|Learn more about %{help_link_start}zones%{help_link_end}."
msgstr "" msgstr ""
msgid "ClusterIntegration|Learn more about Kubernetes" msgid "ClusterIntegration|Learn more about Kubernetes."
msgstr "" msgstr ""
msgid "ClusterIntegration|Learn more about group Kubernetes clusters" msgid "ClusterIntegration|Learn more about group Kubernetes clusters"
...@@ -8377,9 +8365,6 @@ msgstr "" ...@@ -8377,9 +8365,6 @@ msgstr ""
msgid "ClusterIntegration|Number of nodes must be a numerical value." msgid "ClusterIntegration|Number of nodes must be a numerical value."
msgstr "" msgstr ""
msgid "ClusterIntegration|Please enter access information for your Kubernetes cluster. If you need help, you can read our %{linkStart}documentation%{linkEnd} on Kubernetes"
msgstr ""
msgid "ClusterIntegration|Please make sure that your Google account meets the following requirements:" msgid "ClusterIntegration|Please make sure that your Google account meets the following requirements:"
msgstr "" msgstr ""
...@@ -8629,12 +8614,18 @@ msgstr "" ...@@ -8629,12 +8614,18 @@ msgstr ""
msgid "ClusterIntegration|Unknown Error" msgid "ClusterIntegration|Unknown Error"
msgstr "" msgstr ""
msgid "ClusterIntegration|Use GitLab to deploy to your cluster, run jobs, use review apps, and more."
msgstr ""
msgid "ClusterIntegration|Use the %{linkStart}GitLab Agent%{linkEnd} to safely connect your Kubernetes clusters to GitLab. You can deploy your applications, run your pipelines, use Review Apps, and much more." msgid "ClusterIntegration|Use the %{linkStart}GitLab Agent%{linkEnd} to safely connect your Kubernetes clusters to GitLab. You can deploy your applications, run your pipelines, use Review Apps, and much more."
msgstr "" msgstr ""
msgid "ClusterIntegration|Uses the Cloud Run, Istio, and HTTP Load Balancing addons for this cluster." msgid "ClusterIntegration|Uses the Cloud Run, Istio, and HTTP Load Balancing addons for this cluster."
msgstr "" msgstr ""
msgid "ClusterIntegration|Using AutoDevOps with multiple clusters? %{help_link_start}Read this first.%{help_link_end}"
msgstr ""
msgid "ClusterIntegration|VPC" msgid "ClusterIntegration|VPC"
msgstr "" msgstr ""
...@@ -8647,7 +8638,7 @@ msgstr "" ...@@ -8647,7 +8638,7 @@ msgstr ""
msgid "ClusterIntegration|We were unable to fetch any projects. Ensure that you have a project on %{docsLinkStart}Google Cloud Platform%{docsLinkEnd}." msgid "ClusterIntegration|We were unable to fetch any projects. Ensure that you have a project on %{docsLinkStart}Google Cloud Platform%{docsLinkEnd}."
msgstr "" msgstr ""
msgid "ClusterIntegration|With a Kubernetes cluster associated to this project, you can use review apps, deploy your applications, run your pipelines, and much more in an easy way." msgid "ClusterIntegration|Where do you want to create a cluster?"
msgstr "" msgstr ""
msgid "ClusterIntegration|You are about to remove your cluster integration and all GitLab-created resources associated with this cluster." msgid "ClusterIntegration|You are about to remove your cluster integration and all GitLab-created resources associated with this cluster."
...@@ -9351,6 +9342,12 @@ msgstr "" ...@@ -9351,6 +9342,12 @@ msgstr ""
msgid "Connect" msgid "Connect"
msgstr "" msgstr ""
msgid "Connect a Kubernetes Cluster"
msgstr ""
msgid "Connect a cluster"
msgstr ""
msgid "Connect all repositories" msgid "Connect all repositories"
msgstr "" msgstr ""
...@@ -10185,9 +10182,15 @@ msgstr "" ...@@ -10185,9 +10182,15 @@ msgstr ""
msgid "Create a GitLab account first, and then connect it to your %{label} account." msgid "Create a GitLab account first, and then connect it to your %{label} account."
msgstr "" msgstr ""
msgid "Create a Kubernetes cluster"
msgstr ""
msgid "Create a Mattermost team for this group" msgid "Create a Mattermost team for this group"
msgstr "" msgstr ""
msgid "Create a cluster"
msgstr ""
msgid "Create a group" msgid "Create a group"
msgstr "" msgstr ""
......
# frozen_string_literal: true
module QA
module Page
module Project
module Infrastructure
module Kubernetes
class Add < Page::Base
view 'app/views/clusters/clusters/new.html.haml' do
element :add_existing_cluster_tab
end
def add_existing_cluster
page.find('.gl-tab-nav-item', text: 'Connect existing cluster').click
end
end
end
end
end
end
end
...@@ -26,9 +26,6 @@ module QA ...@@ -26,9 +26,6 @@ module QA
Page::Project::Infrastructure::Kubernetes::Index.perform( Page::Project::Infrastructure::Kubernetes::Index.perform(
&:connect_existing_cluster) &:connect_existing_cluster)
Page::Project::Infrastructure::Kubernetes::Add.perform(
&:add_existing_cluster)
Page::Project::Infrastructure::Kubernetes::AddExisting.perform do |cluster_page| Page::Project::Infrastructure::Kubernetes::AddExisting.perform do |cluster_page|
cluster_page.set_cluster_name(@cluster.cluster_name) cluster_page.set_cluster_name(@cluster.cluster_name)
cluster_page.set_api_url(@cluster.api_url) cluster_page.set_api_url(@cluster.api_url)
......
...@@ -8,13 +8,15 @@ RSpec.describe 'Instance-level AWS EKS Cluster', :js do ...@@ -8,13 +8,15 @@ RSpec.describe 'Instance-level AWS EKS Cluster', :js do
before do before do
sign_in(user) sign_in(user)
gitlab_enable_admin_mode_sign_in(user) gitlab_enable_admin_mode_sign_in(user)
stub_application_setting(eks_integration_enabled: true)
end end
context 'when user does not have a cluster and visits group clusters page' do context 'when user does not have a cluster and visits group clusters page' do
before do before do
visit admin_clusters_path visit admin_clusters_path
click_link 'Connect with a certificate' click_button 'Actions'
click_link 'Create a new cluster'
end end
context 'when user creates a cluster on AWS EKS' do context 'when user creates a cluster on AWS EKS' do
...@@ -23,7 +25,7 @@ RSpec.describe 'Instance-level AWS EKS Cluster', :js do ...@@ -23,7 +25,7 @@ RSpec.describe 'Instance-level AWS EKS Cluster', :js do
end end
it 'user sees a form to create an EKS cluster' do it 'user sees a form to create an EKS cluster' do
expect(page).to have_content('Create new cluster on EKS') expect(page).to have_content('Authenticate with Amazon Web Services')
end end
end end
end end
......
...@@ -13,13 +13,15 @@ RSpec.describe 'Group AWS EKS Cluster', :js do ...@@ -13,13 +13,15 @@ RSpec.describe 'Group AWS EKS Cluster', :js do
allow(Groups::ClustersController).to receive(:STATUS_POLLING_INTERVAL) { 100 } allow(Groups::ClustersController).to receive(:STATUS_POLLING_INTERVAL) { 100 }
allow_any_instance_of(Clusters::Kubernetes::CreateOrUpdateNamespaceService).to receive(:execute) allow_any_instance_of(Clusters::Kubernetes::CreateOrUpdateNamespaceService).to receive(:execute)
allow_any_instance_of(Clusters::Cluster).to receive(:retrieve_connection_status).and_return(:connected) allow_any_instance_of(Clusters::Cluster).to receive(:retrieve_connection_status).and_return(:connected)
stub_application_setting(eks_integration_enabled: true)
end end
context 'when user does not have a cluster and visits group clusters page' do context 'when user does not have a cluster and visits group clusters page' do
before do before do
visit group_clusters_path(group) visit group_clusters_path(group)
click_link 'Connect with a certificate' click_button 'Actions'
click_link 'Create a new cluster'
end end
context 'when user creates a cluster on AWS EKS' do context 'when user creates a cluster on AWS EKS' do
...@@ -28,7 +30,7 @@ RSpec.describe 'Group AWS EKS Cluster', :js do ...@@ -28,7 +30,7 @@ RSpec.describe 'Group AWS EKS Cluster', :js do
end end
it 'user sees a form to create an EKS cluster' do it 'user sees a form to create an EKS cluster' do
expect(page).to have_content('Create new cluster on EKS') expect(page).to have_content('Authenticate with Amazon Web Services')
end end
end end
end end
......
...@@ -26,7 +26,6 @@ RSpec.describe 'User Cluster', :js do ...@@ -26,7 +26,6 @@ RSpec.describe 'User Cluster', :js do
visit group_clusters_path(group) visit group_clusters_path(group)
click_link 'Connect with a certificate' click_link 'Connect with a certificate'
click_link 'Connect existing cluster'
end end
context 'when user filled form with valid parameters' do context 'when user filled form with valid parameters' do
......
...@@ -19,8 +19,8 @@ RSpec.describe 'AWS EKS Cluster', :js do ...@@ -19,8 +19,8 @@ RSpec.describe 'AWS EKS Cluster', :js do
before do before do
visit project_clusters_path(project) visit project_clusters_path(project)
click_link 'Certificate' click_button(class: 'dropdown-toggle-split')
click_link 'Connect with a certificate' click_link 'Create a new cluster'
end end
context 'when user creates a cluster on AWS EKS' do context 'when user creates a cluster on AWS EKS' do
...@@ -28,10 +28,6 @@ RSpec.describe 'AWS EKS Cluster', :js do ...@@ -28,10 +28,6 @@ RSpec.describe 'AWS EKS Cluster', :js do
click_link 'Amazon EKS' click_link 'Amazon EKS'
end end
it 'user sees a form to create an EKS cluster' do
expect(page).to have_content('Create new cluster on EKS')
end
it 'highlights Amazon EKS logo' do it 'highlights Amazon EKS logo' do
expect(page).to have_css('.js-create-aws-cluster-button.active') expect(page).to have_css('.js-create-aws-cluster-button.active')
end end
......
...@@ -33,9 +33,7 @@ RSpec.describe 'Gcp Cluster', :js do ...@@ -33,9 +33,7 @@ RSpec.describe 'Gcp Cluster', :js do
before do before do
visit project_clusters_path(project) visit project_clusters_path(project)
click_link 'Certificate' visit_create_cluster_page
click_link 'Connect with a certificate'
click_link 'Create new cluster'
click_link 'Google GKE' click_link 'Google GKE'
end end
...@@ -136,7 +134,6 @@ RSpec.describe 'Gcp Cluster', :js do ...@@ -136,7 +134,6 @@ RSpec.describe 'Gcp Cluster', :js do
before do before do
visit project_clusters_path(project) visit project_clusters_path(project)
click_link 'Certificate'
click_button(class: 'dropdown-toggle-split') click_button(class: 'dropdown-toggle-split')
click_link 'Connect with a certificate' click_link 'Connect with a certificate'
end end
...@@ -166,7 +163,6 @@ RSpec.describe 'Gcp Cluster', :js do ...@@ -166,7 +163,6 @@ RSpec.describe 'Gcp Cluster', :js do
context 'when user has not dismissed GCP signup offer' do context 'when user has not dismissed GCP signup offer' do
before do before do
visit project_clusters_path(project) visit project_clusters_path(project)
click_link 'Certificate'
end end
it 'user sees offer on cluster index page' do it 'user sees offer on cluster index page' do
...@@ -174,7 +170,7 @@ RSpec.describe 'Gcp Cluster', :js do ...@@ -174,7 +170,7 @@ RSpec.describe 'Gcp Cluster', :js do
end end
it 'user sees offer on cluster create page' do it 'user sees offer on cluster create page' do
click_link 'Connect with a certificate' visit_create_cluster_page
expect(page).to have_css('.gcp-signup-offer') expect(page).to have_css('.gcp-signup-offer')
end end
...@@ -192,7 +188,7 @@ RSpec.describe 'Gcp Cluster', :js do ...@@ -192,7 +188,7 @@ RSpec.describe 'Gcp Cluster', :js do
find('.gcp-signup-offer .js-close').click find('.gcp-signup-offer .js-close').click
wait_for_requests wait_for_requests
click_link 'Connect with a certificate' visit_create_cluster_page
expect(page).not_to have_css('.gcp-signup-offer') expect(page).not_to have_css('.gcp-signup-offer')
end end
...@@ -221,4 +217,9 @@ RSpec.describe 'Gcp Cluster', :js do ...@@ -221,4 +217,9 @@ RSpec.describe 'Gcp Cluster', :js do
expect(page).not_to have_css('.gcp-signup-offer') expect(page).not_to have_css('.gcp-signup-offer')
end end
end end
def visit_create_cluster_page
click_button(class: 'dropdown-toggle-split')
click_link 'Create a new cluster'
end
end end
...@@ -27,7 +27,6 @@ RSpec.describe 'User Cluster', :js do ...@@ -27,7 +27,6 @@ RSpec.describe 'User Cluster', :js do
click_link 'Certificate' click_link 'Certificate'
click_link 'Connect with a certificate' click_link 'Connect with a certificate'
click_link 'Connect existing cluster'
end end
context 'when user filled form with valid parameters' do context 'when user filled form with valid parameters' do
......
...@@ -34,17 +34,12 @@ RSpec.describe 'Clusters', :js do ...@@ -34,17 +34,12 @@ RSpec.describe 'Clusters', :js do
before do before do
create(:cluster, :provided_by_user, name: 'default-cluster', environment_scope: '*', projects: [project]) create(:cluster, :provided_by_user, name: 'default-cluster', environment_scope: '*', projects: [project])
visit project_clusters_path(project) visit project_clusters_path(project)
click_link 'Certificate'
click_button(class: 'dropdown-toggle-split')
end
it 'user sees an add cluster button' do
expect(page).to have_content('Connect with a certificate')
end end
context 'when user filled form with environment scope' do context 'when user filled form with environment scope' do
before do before do
click_link 'Connect with a certificate' visit_connect_cluster_page
fill_in 'cluster_name', with: 'staging-cluster' fill_in 'cluster_name', with: 'staging-cluster'
fill_in 'cluster_environment_scope', with: 'staging/*' fill_in 'cluster_environment_scope', with: 'staging/*'
click_button 'Add Kubernetes cluster' click_button 'Add Kubernetes cluster'
...@@ -72,7 +67,8 @@ RSpec.describe 'Clusters', :js do ...@@ -72,7 +67,8 @@ RSpec.describe 'Clusters', :js do
context 'when user updates duplicated environment scope' do context 'when user updates duplicated environment scope' do
before do before do
click_link 'Connect with a certificate' visit_connect_cluster_page
fill_in 'cluster_name', with: 'staging-cluster' fill_in 'cluster_name', with: 'staging-cluster'
fill_in 'cluster_environment_scope', with: '*' fill_in 'cluster_environment_scope', with: '*'
fill_in 'cluster_platform_kubernetes_attributes_api_url', with: 'https://0.0.0.0' fill_in 'cluster_platform_kubernetes_attributes_api_url', with: 'https://0.0.0.0'
...@@ -115,8 +111,7 @@ RSpec.describe 'Clusters', :js do ...@@ -115,8 +111,7 @@ RSpec.describe 'Clusters', :js do
context 'when user filled form with environment scope' do context 'when user filled form with environment scope' do
before do before do
click_button(class: 'dropdown-toggle-split') visit_create_cluster_page
click_link 'Create a new cluster'
click_link 'Google GKE' click_link 'Google GKE'
sleep 2 # wait for ajax sleep 2 # wait for ajax
...@@ -160,8 +155,7 @@ RSpec.describe 'Clusters', :js do ...@@ -160,8 +155,7 @@ RSpec.describe 'Clusters', :js do
context 'when user updates duplicated environment scope' do context 'when user updates duplicated environment scope' do
before do before do
click_button(class: 'dropdown-toggle-split') visit_create_cluster_page
click_link 'Create a new cluster'
click_link 'Google GKE' click_link 'Google GKE'
sleep 2 # wait for ajax sleep 2 # wait for ajax
...@@ -212,11 +206,7 @@ RSpec.describe 'Clusters', :js do ...@@ -212,11 +206,7 @@ RSpec.describe 'Clusters', :js do
context 'user visits create cluster page' do context 'user visits create cluster page' do
before do before do
visit project_clusters_path(project) visit_create_cluster_page
click_link 'Certificate'
click_link 'Connect with a certificate'
click_link 'Create new cluster'
end end
it 'user sees a link to create a GKE cluster' do it 'user sees a link to create a GKE cluster' do
...@@ -227,4 +217,16 @@ RSpec.describe 'Clusters', :js do ...@@ -227,4 +217,16 @@ RSpec.describe 'Clusters', :js do
expect(page).to have_link('Amazon EKS') expect(page).to have_link('Amazon EKS')
end end
end end
def visit_create_cluster_page
visit project_clusters_path(project)
click_button(class: 'dropdown-toggle-split')
click_link 'Create a new cluster'
end
def visit_connect_cluster_page
click_button(class: 'dropdown-toggle-split')
click_link 'Connect with a certificate'
end
end end
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`NewCluster renders the cluster component correctly 1`] = ` exports[`NewCluster renders the cluster component correctly 1`] = `
"<div> "<div class=\\"gl-pt-4\\">
<h4>Enter the details for your Kubernetes cluster</h4> <h4>Enter your Kubernetes cluster certificate details</h4>
<p>Please enter access information for your Kubernetes cluster. If you need help, you can read our <b-link-stub href=\\"/some/help/path\\" target=\\"_blank\\" event=\\"click\\" routertag=\\"a\\" class=\\"gl-link\\">documentation</b-link-stub> on Kubernetes</p> <p>Enter details about your cluster. <b-link-stub href=\\"/some/help/path\\" target=\\"_blank\\" event=\\"click\\" routertag=\\"a\\" class=\\"gl-link\\">How do I use a certificate to connect to my cluster?</b-link-stub>
</p>
</div>" </div>"
`; `;
...@@ -31,9 +31,7 @@ describe('NewCluster', () => { ...@@ -31,9 +31,7 @@ describe('NewCluster', () => {
}); });
it('renders the correct information text', () => { it('renders the correct information text', () => {
expect(findDescription().text()).toContain( expect(findDescription().text()).toContain('Enter details about your cluster.');
'Please enter access information for your Kubernetes cluster.',
);
}); });
it('renders a valid help link set by the backend', () => { it('renders a valid help link set by the backend', () => {
......
...@@ -4,7 +4,7 @@ import ClustersEmptyState from '~/clusters_list/components/clusters_empty_state. ...@@ -4,7 +4,7 @@ import ClustersEmptyState from '~/clusters_list/components/clusters_empty_state.
import ClusterStore from '~/clusters_list/store'; import ClusterStore from '~/clusters_list/store';
const clustersEmptyStateImage = 'path/to/svg'; const clustersEmptyStateImage = 'path/to/svg';
const newClusterPath = '/path/to/connect/cluster'; const addClusterPath = '/path/to/connect/cluster';
const emptyStateHelpText = 'empty state text'; const emptyStateHelpText = 'empty state text';
describe('ClustersEmptyStateComponent', () => { describe('ClustersEmptyStateComponent', () => {
...@@ -12,7 +12,7 @@ describe('ClustersEmptyStateComponent', () => { ...@@ -12,7 +12,7 @@ describe('ClustersEmptyStateComponent', () => {
const defaultProvideData = { const defaultProvideData = {
clustersEmptyStateImage, clustersEmptyStateImage,
newClusterPath, addClusterPath,
}; };
const findButton = () => wrapper.findComponent(GlButton); const findButton = () => wrapper.findComponent(GlButton);
......
...@@ -23,7 +23,7 @@ describe('Clusters', () => { ...@@ -23,7 +23,7 @@ describe('Clusters', () => {
const totalClustersNumber = 6; const totalClustersNumber = 6;
const clustersEmptyStateImage = 'path/to/svg'; const clustersEmptyStateImage = 'path/to/svg';
const emptyStateHelpText = null; const emptyStateHelpText = null;
const newClusterPath = '/path/to/new/cluster'; const addClusterPath = '/path/to/new/cluster';
const entryData = { const entryData = {
endpoint, endpoint,
...@@ -36,7 +36,7 @@ describe('Clusters', () => { ...@@ -36,7 +36,7 @@ describe('Clusters', () => {
const provideData = { const provideData = {
clustersEmptyStateImage, clustersEmptyStateImage,
emptyStateHelpText, emptyStateHelpText,
newClusterPath, addClusterPath,
}; };
const findLoader = () => wrapper.findComponent(GlLoadingIcon); const findLoader = () => wrapper.findComponent(GlLoadingIcon);
......
...@@ -31,34 +31,6 @@ RSpec.describe ClustersHelper do ...@@ -31,34 +31,6 @@ RSpec.describe ClustersHelper do
end end
end end
describe '#create_new_cluster_label' do
subject { helper.create_new_cluster_label(provider: provider) }
context 'GCP provider' do
let(:provider) { 'gcp' }
it { is_expected.to eq('Create new cluster on GKE') }
end
context 'AWS provider' do
let(:provider) { 'aws' }
it { is_expected.to eq('Create new cluster on EKS') }
end
context 'other provider' do
let(:provider) { 'other' }
it { is_expected.to eq('Create new cluster') }
end
context 'no provider' do
let(:provider) { nil }
it { is_expected.to eq('Create new cluster') }
end
end
describe '#js_clusters_list_data' do describe '#js_clusters_list_data' do
let_it_be(:current_user) { create(:user) } let_it_be(:current_user) { create(:user) }
let_it_be(:project) { build(:project) } let_it_be(:project) { build(:project) }
...@@ -89,11 +61,11 @@ RSpec.describe ClustersHelper do ...@@ -89,11 +61,11 @@ RSpec.describe ClustersHelper do
end end
it 'displays create cluster using certificate path' do it 'displays create cluster using certificate path' do
expect(subject[:new_cluster_path]).to eq("#{project_path(project)}/-/clusters/new?tab=create") expect(subject[:new_cluster_path]).to eq("#{project_path(project)}/-/clusters/new")
end end
it 'displays add cluster using certificate path' do it 'displays add cluster using certificate path' do
expect(subject[:add_cluster_path]).to eq("#{project_path(project)}/-/clusters/new?tab=add") expect(subject[:add_cluster_path]).to eq("#{project_path(project)}/-/clusters/connect")
end end
context 'user has no permissions to create a cluster' do context 'user has no permissions to create a cluster' do
......
...@@ -43,6 +43,12 @@ RSpec.describe GroupClusterablePresenter do ...@@ -43,6 +43,12 @@ RSpec.describe GroupClusterablePresenter do
it { is_expected.to eq(new_group_cluster_path(group)) } it { is_expected.to eq(new_group_cluster_path(group)) }
end end
describe '#connect_path' do
subject { presenter.connect_path }
it { is_expected.to eq(connect_group_clusters_path(group)) }
end
describe '#authorize_aws_role_path' do describe '#authorize_aws_role_path' do
subject { presenter.authorize_aws_role_path } subject { presenter.authorize_aws_role_path }
......
...@@ -15,6 +15,12 @@ RSpec.describe InstanceClusterablePresenter do ...@@ -15,6 +15,12 @@ RSpec.describe InstanceClusterablePresenter do
it { is_expected.to eq(create_aws_admin_clusters_path) } it { is_expected.to eq(create_aws_admin_clusters_path) }
end end
describe '#connect_path' do
subject { described_class.new(instance).connect_path }
it { is_expected.to eq(connect_admin_clusters_path) }
end
describe '#authorize_aws_role_path' do describe '#authorize_aws_role_path' do
subject { described_class.new(instance).authorize_aws_role_path } subject { described_class.new(instance).authorize_aws_role_path }
......
...@@ -43,6 +43,12 @@ RSpec.describe ProjectClusterablePresenter do ...@@ -43,6 +43,12 @@ RSpec.describe ProjectClusterablePresenter do
it { is_expected.to eq(new_project_cluster_path(project)) } it { is_expected.to eq(new_project_cluster_path(project)) }
end end
describe '#connect_path' do
subject { presenter.connect_path }
it { is_expected.to eq(connect_project_clusters_path(project)) }
end
describe '#authorize_aws_role_path' do describe '#authorize_aws_role_path' do
subject { presenter.authorize_aws_role_path } subject { presenter.authorize_aws_role_path }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment