Add cluster domain warning
Added a cluster domain wanring if no domain is defined
This commit is contained in:
parent
b4f9f5e7ec
commit
85f89d21aa
4 changed files with 31 additions and 5 deletions
|
@ -1,3 +1,14 @@
|
|||
- has_base_domain = @project.all_clusters.any? { |cluster| cluster.base_domain && !cluster.base_domain.empty? }
|
||||
|
||||
- link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe
|
||||
- link_end = '</a>'.html_safe
|
||||
|
||||
- kubernetes_cluster_path = help_page_path('user/project/clusters/index')
|
||||
- kubernetes_cluster_link_start = link_start % { url: kubernetes_cluster_path }
|
||||
|
||||
- base_domain_path = help_page_path('user/project/clusters/index', anchor: 'base-domain')
|
||||
- base_domain_link_start = link_start % { url: base_domain_path }
|
||||
|
||||
.row
|
||||
.col-lg-12
|
||||
= form_for @project, url: project_settings_ci_cd_path(@project, anchor: 'autodevops-settings') do |f|
|
||||
|
@ -19,9 +30,10 @@
|
|||
.card-footer.js-extra-settings{ class: auto_devops_enabled || 'hidden' }
|
||||
- if @project.all_clusters.empty?
|
||||
%p.settings-message.text-center
|
||||
- kubernetes_cluster_link = help_page_path('user/project/clusters/index')
|
||||
- kubernetes_cluster_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: kubernetes_cluster_link }
|
||||
= s_('CICD|You must add a %{kubernetes_cluster_start}Kubernetes cluster integration%{kubernetes_cluster_end} to this project with a domain in order for your deployment strategy to work correctly.').html_safe % { kubernetes_cluster_start: kubernetes_cluster_start, kubernetes_cluster_end: '</a>'.html_safe }
|
||||
= s_('CICD|You must add a %{kubernetes_cluster_link_start}Kubernetes cluster integration%{link_end} to this project with a domain in order for your deployment strategy to work correctly.').html_safe % { kubernetes_cluster_link_start: kubernetes_cluster_link_start, link_end: link_end }
|
||||
- elsif !has_base_domain
|
||||
%p.settings-message.text-center
|
||||
= s_('CICD|You must add a %{base_domain_link_start}base domain%{link_end} to your %{kubernetes_cluster_link_start}Kubernetes cluster%{link_end} in order for your deployment strategy to work.').html_safe % { base_domain_link_start: base_domain_link_start, kubernetes_cluster_link_start: kubernetes_cluster_link_start, link_end: link_end }
|
||||
%label.prepend-top-10
|
||||
%strong= s_('CICD|Deployment strategy')
|
||||
.form-check
|
||||
|
|
5
changelogs/unreleased/je-add-cluster-domain-warning.yml
Normal file
5
changelogs/unreleased/je-add-cluster-domain-warning.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Add cluster domain warning
|
||||
merge_request: 32260
|
||||
author:
|
||||
type: changed
|
|
@ -1960,7 +1960,10 @@ msgstr ""
|
|||
msgid "CICD|The Auto DevOps pipeline will run if no alternative CI configuration file is found."
|
||||
msgstr ""
|
||||
|
||||
msgid "CICD|You must add a %{kubernetes_cluster_start}Kubernetes cluster integration%{kubernetes_cluster_end} to this project with a domain in order for your deployment strategy to work correctly."
|
||||
msgid "CICD|You must add a %{base_domain_link_start}base domain%{link_end} to your %{kubernetes_cluster_link_start}Kubernetes cluster%{link_end} in order for your deployment strategy to work."
|
||||
msgstr ""
|
||||
|
||||
msgid "CICD|You must add a %{kubernetes_cluster_link_start}Kubernetes cluster integration%{link_end} to this project with a domain in order for your deployment strategy to work correctly."
|
||||
msgstr ""
|
||||
|
||||
msgid "CICD|group enabled"
|
||||
|
|
|
@ -17,10 +17,16 @@ describe 'projects/settings/ci_cd/_autodevops_form' do
|
|||
context 'when the project has an available kubernetes cluster' do
|
||||
let!(:cluster) { create(:cluster, cluster_type: :project_type, projects: [project]) }
|
||||
|
||||
it 'does not show a warning message' do
|
||||
it 'does not show a warning message about Kubernetes cluster' do
|
||||
render
|
||||
|
||||
expect(rendered).not_to have_text('You must add a Kubernetes cluster')
|
||||
end
|
||||
|
||||
it 'shows a warning message about base domain' do
|
||||
render
|
||||
|
||||
expect(rendered).to have_text('You must add a base domain to your Kubernetes cluster in order for your deployment strategy to work.')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue