Class: Clusters::Cleanup::ServiceAccountWorker

Inherits:
Object
  • Object
show all
Includes:
ClusterCleanupMethods
Defined in:
app/workers/clusters/cleanup/service_account_worker.rb

Overview

rubocop:disable Scalability/IdempotentWorker

Constant Summary

Constants included from ClusterCleanupMethods

ClusterCleanupMethods::DEFAULT_EXECUTION_LIMIT, ClusterCleanupMethods::ExceededExecutionLimitError

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT

Constants included from Gitlab::Loggable

Gitlab::Loggable::ANONYMOUS

Constants included from WorkerAttributes

WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from Gitlab::Loggable

#build_structured_payload

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#perform(cluster_id) ⇒ Object



8
9
10
11
12
13
14
# File 'app/workers/clusters/cleanup/service_account_worker.rb', line 8

def perform(cluster_id)
  Clusters::Cluster.find_by_id(cluster_id).try do |cluster|
    break unless cluster.cleanup_removing_service_account?

    Clusters::Cleanup::ServiceAccountService.new(cluster).execute
  end
end