Skip to content

Commit 0bde4f7

Browse files
author
ddakov
committed
control-service: fix data jobs builds
Change the way the success of a data job build is evaluated since newer version of K8s notify earlier with different job conditions. Signed-off-by: Dako Dakov <ddakov@vmware.com>
1 parent 1b99496 commit 0bde4f7

File tree

1 file changed

+12
-10
lines changed
  • projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service

1 file changed

+12
-10
lines changed

projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/KubernetesService.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,22 +1188,24 @@ private JobStatusCondition getJobCondition(V1Job job) {
11881188
V1JobStatus jobStatus = job.getStatus();
11891189
if (jobStatus.getConditions() != null) {
11901190
if (jobStatus.getConditions().size() > 1) {
1191-
log.warn("More than one Job conditions found, returning first only. Job: {}", job);
1191+
log.warn("More than one Job conditions found. Job: {}", job);
11921192
}
11931193
for (var c : jobStatus.getConditions()) {
1194-
log.trace(
1194+
log.debug(
11951195
"k8s job condition type: {} reason: {} message: {}",
11961196
c.getType(),
11971197
c.getReason(),
11981198
c.getMessage());
1199-
return new JobStatusCondition(
1200-
c.getType().equals("Complete"),
1201-
c.getType(),
1202-
c.getReason(),
1203-
c.getMessage(),
1204-
c.getLastTransitionTime() != null
1205-
? c.getLastTransitionTime().toInstant().toEpochMilli()
1206-
: 0);
1199+
if (c.getType().equals("Complete") || c.getType().equals("SuccessCriteriaMet")){
1200+
return new JobStatusCondition(
1201+
c.getType().equals("Complete") || c.getType().equals("SuccessCriteriaMet"),
1202+
c.getType(),
1203+
c.getReason(),
1204+
c.getMessage(),
1205+
c.getLastTransitionTime() != null
1206+
? c.getLastTransitionTime().toInstant().toEpochMilli()
1207+
: 0);
1208+
}
12071209
}
12081210
}
12091211
return null;

0 commit comments

Comments
 (0)