diff options
| author | James Fargher <proglottis@gmail.com> | 2019-04-18 14:45:31 +1200 |
|---|---|---|
| committer | James Fargher <proglottis@gmail.com> | 2019-05-07 08:37:03 +1200 |
| commit | 8db382b05545fdef0a60bcff65f8c23e8b1ed282 (patch) | |
| tree | 48c45052013b98a571ce73a6b2239a9ea050e414 /app/controllers/admin | |
| parent | 733da6d6a015e8c951dcc02250cfe1fab87789c0 (diff) | |
| download | gitlab-ce-8db382b05545fdef0a60bcff65f8c23e8b1ed282.tar.gz | |
Allow projects to use instance level clusters
There are two cluster hierarchies one for the deployment platform and
one for controllers. The main difference is that deployment platforms do
not check user permissions and only return the first match.
Diffstat (limited to 'app/controllers/admin')
| -rw-r--r-- | app/controllers/admin/clusters_controller.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/admin/clusters_controller.rb b/app/controllers/admin/clusters_controller.rb index 777bdf5c981..f2b54125d48 100644 --- a/app/controllers/admin/clusters_controller.rb +++ b/app/controllers/admin/clusters_controller.rb @@ -8,10 +8,18 @@ class Admin::ClustersController < Clusters::ClustersController private def clusterable - @clusterable ||= InstanceClusterablePresenter.fabricate(Clusters::Instance.new, current_user: current_user) + @clusterable ||= InstanceClusterablePresenter.fabricate(cluster_instance, current_user: current_user) + end + + def cluster_instance + @cluster_instance ||= Clusters::Instance.new end def check_instance_clusters_feature_flag! - render_404 unless Feature.enabled?(:instance_clusters, default_enabled: true) + render_404 unless instance_clusters_enabled? + end + + def instance_clusters_enabled? + cluster_instance.instance_clusters_enabled? end end |
