diff options
Diffstat (limited to 'app/helpers/clusters_helper.rb')
-rw-r--r-- | app/helpers/clusters_helper.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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 |