Skip to content

Commit 0e24d18

Browse files
asm582openshift-ci[bot]
authored andcommitted
move check up the addqueuejob method
1 parent 2436df8 commit 0e24d18

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/controller/queuejob/queuejob_controller_ex.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,10 @@ func (cc *XController) addQueueJob(obj interface{}) {
15691569
return
15701570
}
15711571
klog.V(6).Infof("[Informer-addQJ] %s/%s", qj.Namespace, qj.Name)
1572+
if qj.Status.State == arbv1.AppWrapperStateCompleted || qj.Status.State == arbv1.AppWrapperStateFailed {
1573+
klog.V(2).Infof("[Informer-addQJ] Skipping processing of AW %s with state %s", qj.Name, qj.Status.State)
1574+
return
1575+
}
15721576
if qj.Status.QueueJobState == "" {
15731577
qj.Status.ControllerFirstTimestamp = firstTime
15741578
qj.Status.SystemPriority = float64(qj.Spec.Priority)
@@ -1627,7 +1631,7 @@ func (cc *XController) addQueueJob(obj interface{}) {
16271631
klog.V(2).Infof("[Informer-addQJ] Stopping requeue for AW %s/%s with status %s", latestAw.Namespace, latestAw.Name, latestAw.Status.State)
16281632
AwinEtcd, err := cc.arbclients.WorkloadV1beta1().AppWrappers(latestAw.Namespace).Get(context.Background(), latestAw.Name, metav1.GetOptions{})
16291633
if apierrors.IsNotFound(err) {
1630-
//AW is already completed when MCAD is restarted.
1634+
klog.V(2).Infof("[Informer-addQJ] Stopped requeueing of AW due to error %v\n", err)
16311635
break
16321636
} else if AwinEtcd.Status.State == latestAw.Status.State && err != nil {
16331637
break // Exit the loop

0 commit comments

Comments
 (0)