Commit 6cd98a30 authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason Committed by Denys Mishunov

Always show "Clear cluster cache" button

This adds the ability to clear the cluster cache for non-managed
clusters. This is necessary as they may have residual cached namespaces
interfering with namespace customization.

See https://gitlab.com/gitlab-org/gitlab/-/issues/208734
parent f41942ff
......@@ -26,13 +26,16 @@
= link_to _('More information'), help_page_path('user/clusters/management_project.md'), target: '_blank'
= field.submit _('Save changes'), class: 'btn btn-success'
- if @cluster.managed?
.sub-section.form-group
%h4
= s_('ClusterIntegration|Clear cluster cache')
%p
= s_("ClusterIntegration|Clear the local cache of namespace and service accounts. This is necessary if your integration has become out of sync. The cache is repopulated during the next CI job that requires namespace and service accounts.")
= link_to(s_('ClusterIntegration|Clear cluster cache'), clusterable.clear_cluster_cache_path(@cluster), method: :delete, class: 'btn btn-primary')
.sub-section.form-group
%h4
= s_('ClusterIntegration|Clear cluster cache')
%p
= s_("ClusterIntegration|Clear the local cache of namespace and service accounts.")
- if @cluster.managed?
= s_("ClusterIntegration|This is necessary if your integration has become out of sync. The cache is repopulated during the next CI job that requires namespace and service accounts.")
- else
= s_("ClusterIntegration|This is necessary to clear existing environment-namespace associations from clusters previously managed by GitLab.")
= link_to(s_('ClusterIntegration|Clear cluster cache'), clusterable.clear_cluster_cache_path(@cluster), method: :delete, class: 'btn btn-primary')
.sub-section.form-group
%h4.text-danger
......
---
title: Always show the "Clear cluster cache" button among the advanced Kubernetes cluster configuration options
merge_request: 43619
author:
type: changed
......@@ -5520,7 +5520,7 @@ msgstr ""
msgid "ClusterIntegration|Clear cluster cache"
msgstr ""
msgid "ClusterIntegration|Clear the local cache of namespace and service accounts. This is necessary if your integration has become out of sync. The cache is repopulated during the next CI job that requires namespace and service accounts."
msgid "ClusterIntegration|Clear the local cache of namespace and service accounts."
msgstr ""
msgid "ClusterIntegration|Cluster management project (alpha)"
......@@ -6219,6 +6219,12 @@ msgstr ""
msgid "ClusterIntegration|This account must have permissions to create a Kubernetes cluster in the %{link_to_container_project} specified below"
msgstr ""
msgid "ClusterIntegration|This is necessary if your integration has become out of sync. The cache is repopulated during the next CI job that requires namespace and service accounts."
msgstr ""
msgid "ClusterIntegration|This is necessary to clear existing environment-namespace associations from clusters previously managed by GitLab."
msgstr ""
msgid "ClusterIntegration|This option will allow you to install applications on RBAC clusters."
msgstr ""
......
......@@ -87,6 +87,7 @@ RSpec.describe 'Clusterable > Show page' do
within('#advanced-settings-section') do
expect(page).to have_content('Google Kubernetes Engine')
expect(page).to have_content('Manage your Kubernetes cluster by visiting')
expect_common_advanced_options
end
end
end
......@@ -117,6 +118,7 @@ RSpec.describe 'Clusterable > Show page' do
within('#advanced-settings-section') do
expect(page).not_to have_content('Google Kubernetes Engine')
expect(page).not_to have_content('Manage your Kubernetes cluster by visiting')
expect_common_advanced_options
end
end
end
......@@ -176,4 +178,14 @@ RSpec.describe 'Clusterable > Show page' do
let(:cluster) { create(:cluster, :provided_by_user, :instance) }
end
end
private
def expect_common_advanced_options
aggregate_failures do
expect(page).to have_content('Cluster management project')
expect(page).to have_content('Clear cluster cache')
expect(page).to have_content('Remove Kubernetes cluster integration')
end
end
end
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