summaryrefslogtreecommitdiff
path: root/app/services/clusters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-15 21:10:04 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-15 21:10:04 +0000
commit83d921d51bd5bf8bd0ecd078706d7c037fb711cb (patch)
treef8f43552f05e747c06d16ac82b23eb33182a9e8f /app/services/clusters
parenta8476fe0cd764ac054763032b7cf6e63b0b493c5 (diff)
downloadgitlab-ce-83d921d51bd5bf8bd0ecd078706d7c037fb711cb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/clusters')
-rw-r--r--app/services/clusters/cleanup/app_service.rb33
-rw-r--r--app/services/clusters/cleanup/project_namespace_service.rb2
-rw-r--r--app/services/clusters/cleanup/service_account_service.rb2
3 files changed, 2 insertions, 35 deletions
diff --git a/app/services/clusters/cleanup/app_service.rb b/app/services/clusters/cleanup/app_service.rb
deleted file mode 100644
index a7e29c78ea0..00000000000
--- a/app/services/clusters/cleanup/app_service.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-module Clusters
- module Cleanup
- class AppService < Clusters::Cleanup::BaseService
- def execute
- persisted_applications = @cluster.persisted_applications
-
- persisted_applications.each do |app|
- next unless app.available?
- next unless app.can_uninstall?
-
- log_event(:uninstalling_app, application: app.class.application_name)
- uninstall_app_async(app)
- end
-
- # Keep calling the worker untill all dependencies are uninstalled
- return schedule_next_execution(Clusters::Cleanup::AppWorker) if persisted_applications.any?
-
- log_event(:schedule_remove_project_namespaces)
- cluster.continue_cleanup!
- end
-
- private
-
- def uninstall_app_async(application)
- application.make_scheduled!
-
- Clusters::Applications::UninstallWorker.perform_async(application.name, application.id)
- end
- end
- end
-end
diff --git a/app/services/clusters/cleanup/project_namespace_service.rb b/app/services/clusters/cleanup/project_namespace_service.rb
index 7621be565ff..16254041306 100644
--- a/app/services/clusters/cleanup/project_namespace_service.rb
+++ b/app/services/clusters/cleanup/project_namespace_service.rb
@@ -2,7 +2,7 @@
module Clusters
module Cleanup
- class ProjectNamespaceService < BaseService
+ class ProjectNamespaceService < ::Clusters::Cleanup::BaseService
KUBERNETES_NAMESPACE_BATCH_SIZE = 100
def execute
diff --git a/app/services/clusters/cleanup/service_account_service.rb b/app/services/clusters/cleanup/service_account_service.rb
index d60bd76d388..baac9e4a9e7 100644
--- a/app/services/clusters/cleanup/service_account_service.rb
+++ b/app/services/clusters/cleanup/service_account_service.rb
@@ -2,7 +2,7 @@
module Clusters
module Cleanup
- class ServiceAccountService < BaseService
+ class ServiceAccountService < ::Clusters::Cleanup::BaseService
def execute
delete_gitlab_service_account