summaryrefslogtreecommitdiff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authorJames Fargher <proglottis@gmail.com>2019-04-18 14:45:31 +1200
committerJames Fargher <proglottis@gmail.com>2019-05-07 08:37:03 +1200
commit8db382b05545fdef0a60bcff65f8c23e8b1ed282 (patch)
tree48c45052013b98a571ce73a6b2239a9ea050e414 /app/controllers/admin
parent733da6d6a015e8c951dcc02250cfe1fab87789c0 (diff)
downloadgitlab-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.rb12
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