Fix kubernetes cleanup to retry delete
							parent
							
								
									ad0dfc7b72
								
							
						
					
					
						commit
						3f4d4bf331
					
				|  | @ -1943,6 +1943,7 @@ class Kubernetes { | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|     runTask(buildGuid, image, commands, mountdir, workingdir, environment, secrets) { |     runTask(buildGuid, image, commands, mountdir, workingdir, environment, secrets) { | ||||||
|  |         var _a; | ||||||
|         return __awaiter(this, void 0, void 0, function* () { |         return __awaiter(this, void 0, void 0, function* () { | ||||||
|             try { |             try { | ||||||
|                 // setup
 |                 // setup
 | ||||||
|  | @ -1954,7 +1955,8 @@ class Kubernetes { | ||||||
|                 const jobSpec = kubernetes_job_spec_factory_1.default.getJobSpec(commands, image, mountdir, workingdir, environment, secrets, this.buildGuid, this.buildParameters, this.secretName, this.pvcName, this.jobName, k8s); |                 const jobSpec = kubernetes_job_spec_factory_1.default.getJobSpec(commands, image, mountdir, workingdir, environment, secrets, this.buildGuid, this.buildParameters, this.secretName, this.pvcName, this.jobName, k8s); | ||||||
|                 //run
 |                 //run
 | ||||||
|                 cloud_runner_logger_1.default.log('Creating build job'); |                 cloud_runner_logger_1.default.log('Creating build job'); | ||||||
|                 yield this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec); |                 this.jobName = | ||||||
|  |                     ((_a = (yield this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec)).body.metadata) === null || _a === void 0 ? void 0 : _a.name) || this.jobName; | ||||||
|                 yield new Promise((promise) => setTimeout(promise, 5000)); |                 yield new Promise((promise) => setTimeout(promise, 5000)); | ||||||
|                 cloud_runner_logger_1.default.log('Job created'); |                 cloud_runner_logger_1.default.log('Job created'); | ||||||
|                 this.setPodNameAndContainerName(yield Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace)); |                 this.setPodNameAndContainerName(yield Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace)); | ||||||
|  |  | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -96,7 +96,9 @@ class Kubernetes implements CloudRunnerProviderInterface { | ||||||
| 
 | 
 | ||||||
|       //run
 |       //run
 | ||||||
|       CloudRunnerLogger.log('Creating build job'); |       CloudRunnerLogger.log('Creating build job'); | ||||||
|       await this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec); |       this.jobName = | ||||||
|  |         (await this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec)).body.metadata?.name || this.jobName; | ||||||
|  | 
 | ||||||
|       await new Promise((promise) => setTimeout(promise, 5000)); |       await new Promise((promise) => setTimeout(promise, 5000)); | ||||||
|       CloudRunnerLogger.log('Job created'); |       CloudRunnerLogger.log('Job created'); | ||||||
|       this.setPodNameAndContainerName(await Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace)); |       this.setPodNameAndContainerName(await Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace)); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue