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

Constants included from WorkerAttributes

WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

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