From 3d3d09fa9d0ea81f0e20037f64bd43b0cd1e5891 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Tue, 20 Feb 2018 13:49:35 +1100 Subject: Schedule Ingress IP address fetch from K8s after clusters page load (#42643) --- app/controllers/projects/clusters_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/controllers/projects/clusters_controller.rb') diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index 142e8b6e4bc..c351caeeb7b 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -4,6 +4,7 @@ class Projects::ClustersController < Projects::ApplicationController before_action :authorize_create_cluster!, only: [:new] before_action :authorize_update_cluster!, only: [:update] before_action :authorize_admin_cluster!, only: [:destroy] + before_action :sync_application_details, only: [:status] STATUS_POLLING_INTERVAL = 10_000 @@ -114,4 +115,8 @@ class Projects::ClustersController < Projects::ApplicationController def authorize_admin_cluster! access_denied! unless can?(current_user, :admin_cluster, cluster) end + + def sync_application_details + @cluster.applications.each(&:sync_details) + end end -- cgit v1.2.1 From 3b320d675fe058311d921e26cd89b2e703310b21 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Fri, 23 Feb 2018 09:08:12 +1100 Subject: Simplify retrying for ClusterWaitForIngressIpAddressWorker and style changes (#42643) --- app/controllers/projects/clusters_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/controllers/projects/clusters_controller.rb') diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index c351caeeb7b..aeaba3a0acf 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -4,7 +4,7 @@ class Projects::ClustersController < Projects::ApplicationController before_action :authorize_create_cluster!, only: [:new] before_action :authorize_update_cluster!, only: [:update] before_action :authorize_admin_cluster!, only: [:destroy] - before_action :sync_application_details, only: [:status] + before_action :update_applications_status, only: [:status] STATUS_POLLING_INTERVAL = 10_000 @@ -116,7 +116,7 @@ class Projects::ClustersController < Projects::ApplicationController access_denied! unless can?(current_user, :admin_cluster, cluster) end - def sync_application_details - @cluster.applications.each(&:sync_details) + def update_applications_status + @cluster.applications.each(&:schedule_status_update) end end -- cgit v1.2.1