Skip to content

Commit 4389e38

Browse files
dakodakovddakov
andauthored
control-service: fix data jobs builds (#3459)
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: ddakov <ddakov@vmware.com> Co-authored-by: ddakov <ddakov@vmware.com> Co-authored-by: github-actions <>
1 parent 1b99496 commit 4389e38

File tree

1 file changed

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

1 file changed

+13
-11
lines changed

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,24 +1186,26 @@ public void watchJobs(
11861186

11871187
private JobStatusCondition getJobCondition(V1Job job) {
11881188
V1JobStatus jobStatus = job.getStatus();
1189-
if (jobStatus.getConditions() != null) {
1189+
if (jobStatus != null && 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)