From 733da6d6a015e8c951dcc02250cfe1fab87789c0 Mon Sep 17 00:00:00 2001 From: James Fargher Date: Wed, 10 Apr 2019 14:13:43 +1200 Subject: Instance level kubernetes clusters admin Instance level clusters were already mostly supported, this change adds admin area controllers for cluster CRUD --- .../admin/clusters/applications_controller.rb | 9 +++++++++ app/controllers/admin/clusters_controller.rb | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 app/controllers/admin/clusters/applications_controller.rb create mode 100644 app/controllers/admin/clusters_controller.rb (limited to 'app/controllers') diff --git a/app/controllers/admin/clusters/applications_controller.rb b/app/controllers/admin/clusters/applications_controller.rb new file mode 100644 index 00000000000..3351d3ff825 --- /dev/null +++ b/app/controllers/admin/clusters/applications_controller.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class Admin::Clusters::ApplicationsController < Clusters::ApplicationsController + private + + def clusterable + @clusterable ||= InstanceClusterablePresenter.fabricate(Clusters::Instance.new, current_user: current_user) + end +end diff --git a/app/controllers/admin/clusters_controller.rb b/app/controllers/admin/clusters_controller.rb new file mode 100644 index 00000000000..777bdf5c981 --- /dev/null +++ b/app/controllers/admin/clusters_controller.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class Admin::ClustersController < Clusters::ClustersController + prepend_before_action :check_instance_clusters_feature_flag! + + layout 'admin' + + private + + def clusterable + @clusterable ||= InstanceClusterablePresenter.fabricate(Clusters::Instance.new, current_user: current_user) + end + + def check_instance_clusters_feature_flag! + render_404 unless Feature.enabled?(:instance_clusters, default_enabled: true) + end +end -- cgit v1.2.3