fix k8s task run fail (#13348)

This commit is contained in:
caishunfeng 2023-01-06 12:44:12 +11:00 committed by zhuangchong
parent 299619c511
commit 05f3417ea4
1 changed files with 5 additions and 0 deletions

View File

@ -141,8 +141,13 @@ public class K8sTaskExecutor extends AbstractK8sTaskExecutor {
@Override
public void eventReceived(Action action, Job job) {
logger.info("event received : job:{} action:{}", job.getMetadata().getName(), action);
if (action != Action.ADDED) {
int jobStatus = getK8sJobStatus(job);
logger.info("job {} status {}", job.getMetadata().getName(), jobStatus);
if (jobStatus == TaskConstants.RUNNING_CODE) {
return;
}
setTaskStatus(jobStatus, taskInstanceId, taskResponse, k8STaskMainParameters);
countDownLatch.countDown();
}