21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'app/jobs/uffizzi_core/deployment/create_credential_job.rb', line 21
def perform(deployment_id, credential_id)
Rails.logger.info("DEPLOYMENT_PROCESS deployment_id=#{deployment_id} CreateCredentialJob(cred_id:#{credential_id})")
deployment = UffizziCore::Deployment.find(deployment_id)
credential = UffizziCore::Credential.find(credential_id)
if deployment.disabled?
Rails.logger.info("DEPLOYMENT_PROCESS deployment_id=#{deployment.id} deployment was disabled stop creating credential")
return
end
unless UffizziCore::ControllerService.namespace_exists?(deployment)
raise UffizziCore::DeploymentNotFoundError,
deployment_id
end
UffizziCore::ControllerService.apply_credential(deployment, credential)
end
|