Skip to content

Commit 2436df8

Browse files
asm582openshift-ci[bot]
authored andcommitted
skip completed AWs after MCAD restart
1 parent ccec55c commit 2436df8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/controller/queuejob/queuejob_controller_ex.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ func (qjm *XController) GetAggregatedResources(cqj *arbv1.AppWrapper) *clusterst
640640
}
641641
allocated = allocated.Add(qjv)
642642
}
643-
643+
klog.V(2).Infof("[GetAggregatedResources] Total resources needed to dispatch AW as reported in custompodresources is %v", allocated)
644644
return allocated
645645
}
646646

@@ -1626,7 +1626,10 @@ func (cc *XController) addQueueJob(obj interface{}) {
16261626
if latestAw.Status.State != arbv1.AppWrapperStateActive && latestAw.Status.State != arbv1.AppWrapperStateEnqueued && latestAw.Status.State != arbv1.AppWrapperStateRunningHoldCompletion {
16271627
klog.V(2).Infof("[Informer-addQJ] Stopping requeue for AW %s/%s with status %s", latestAw.Namespace, latestAw.Name, latestAw.Status.State)
16281628
AwinEtcd, err := cc.arbclients.WorkloadV1beta1().AppWrappers(latestAw.Namespace).Get(context.Background(), latestAw.Name, metav1.GetOptions{})
1629-
if AwinEtcd.Status.State == latestAw.Status.State && err != nil {
1629+
if apierrors.IsNotFound(err) {
1630+
//AW is already completed when MCAD is restarted.
1631+
break
1632+
} else if AwinEtcd.Status.State == latestAw.Status.State && err != nil {
16301633
break // Exit the loop
16311634
}
16321635
}

0 commit comments

Comments
 (0)