Class: Clusters::Cleanup::ProjectNamespaceService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/clusters/cleanup/project_namespace_service.rb

Constant Summary collapse

KUBERNETES_NAMESPACE_BATCH_SIZE =
100

Constants inherited from BaseService

BaseService::DEFAULT_EXECUTION_INTERVAL

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Clusters::Cleanup::BaseService

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
# File 'app/services/clusters/cleanup/project_namespace_service.rb', line 8

def execute
  delete_project_namespaces_in_batches

  # Keep calling the worker untill all namespaces are deleted
  if cluster.kubernetes_namespaces.exists?
    return schedule_next_execution(Clusters::Cleanup::ProjectNamespaceWorker)
  end

  cluster.continue_cleanup!
end