From de2fb5b82c92c90f90ed67ced45143c04e934fb8 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 10 Apr 2020 15:09:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/helpers/clusters_helper.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/helpers/clusters_helper.rb') diff --git a/app/helpers/clusters_helper.rb b/app/helpers/clusters_helper.rb index 21bd2ff9e32..a97216f8a22 100644 --- a/app/helpers/clusters_helper.rb +++ b/app/helpers/clusters_helper.rb @@ -41,6 +41,23 @@ module ClustersHelper end end + def cluster_type_label(cluster_type) + case cluster_type + when 'project_type' + s_('ClusterIntegration|Project cluster') + when 'group_type' + s_('ClusterIntegration|Group cluster') + when 'instance_type' + s_('ClusterIntegration|Instance cluster') + else + Gitlab::ErrorTracking.track_and_raise_for_dev_exception( + ArgumentError.new('Cluster Type Missing'), + cluster_error: { error: 'Cluster Type Missing', cluster_type: cluster_type } + ) + _('Cluster') + end + end + def has_rbac_enabled?(cluster) return cluster.platform_kubernetes_rbac? if cluster.platform_kubernetes -- cgit v1.2.1