summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorJoão Cunha <j.a.cunha@gmail.com>2019-02-18 17:06:51 +0000
committerjerasmus <jerasmus@gitlab.com>2019-03-05 08:32:51 +0200
commitf8234d9a086a43a95698da13d2734fe62ddb9ad7 (patch)
tree14ac13feff76a5e622e26e58393863761a9eaa19 /app/workers
parentcf1b85dd726c1947f9ff2af8d89aa240747f462d (diff)
downloadgitlab-ce-f8234d9a086a43a95698da13d2734fe62ddb9ad7.tar.gz
Creates Clusterss::ApplciationsController update endpoint
- Creates new route - Creates new controller action - Creates call stack: Clusterss::ApplciationsController calls --> Clusters::Applications::UpdateService calls --> Clusters::Applications::ScheduleUpdateService calls --> ClusterUpdateAppWorker calls --> Clusters::Applications::PatchService --> ClusterWaitForAppInstallationWorker DRY req params Adds gcp_cluster:cluster_update_app queue Schedule_update_service is uneeded Extract common logic to a parent class (UpdateService will need it) Introduce new UpdateService Fix rescue class namespace Fix RuboCop offenses Adds BaseService for create and update services Remove request_handler code duplication Fixes update command Move update_command to ApplicationCore so all apps can use it Adds tests for Knative update_command Adds specs for PatchService Raise error if update receives an unistalled app Adds update_service spec Fix RuboCop offense Use subject in favor of go Adds update endpoint specs for project namespace Adds update endpoint specs for group namespace
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/all_queues.yml1
-rw-r--r--app/workers/cluster_update_app_worker.rb13
2 files changed, 14 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index d86f654dd44..bc7db5669e1 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -23,6 +23,7 @@
- cronjob:prune_web_hook_logs
- gcp_cluster:cluster_install_app
+- gcp_cluster:cluster_update_app
- gcp_cluster:cluster_upgrade_app
- gcp_cluster:cluster_provision
- gcp_cluster:cluster_wait_for_app_installation
diff --git a/app/workers/cluster_update_app_worker.rb b/app/workers/cluster_update_app_worker.rb
new file mode 100644
index 00000000000..bec422c34a9
--- /dev/null
+++ b/app/workers/cluster_update_app_worker.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ClusterUpdateAppWorker
+ include ApplicationWorker
+ include ClusterQueue
+ include ClusterApplications
+
+ def perform(app_name, app_id)
+ find_application(app_name, app_id) do |app|
+ Clusters::Applications::PatchService.new(app).execute
+ end
+ end
+end