Skip to content

Commit 4159106

Browse files
asm582openshift-merge-robot
authored andcommitted
add break condition
1 parent d88044d commit 4159106

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/controller/queuejob/queuejob_controller_ex.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,6 +1704,10 @@ func (cc *XController) updateQueueJob(oldObj, newObj interface{}) {
17041704
for {
17051705
time.Sleep(requeueInterval)
17061706
latestAw, exists, err := cc.appwrapperInformer.Informer().GetStore().GetByKey(key)
1707+
if latestAw.(*arbv1.AppWrapper).Status.State == arbv1.AppWrapperStateCompleted || latestAw.(arbv1.AppWrapper).Status.State == arbv1.AppWrapperStateFailed || latestAw.(arbv1.AppWrapper).Status.State == arbv1.AppWrapperStateDeleted {
1708+
klog.V(2).Infof("[Informer-updateQJ] Stopping requeue for AW %s with status %s", latestAw.(*arbv1.AppWrapper).Name, latestAw.(*arbv1.AppWrapper).Status.State)
1709+
break
1710+
}
17071711
if err == nil && exists {
17081712
// Enqueue the latest copy of the AW.
17091713
if (newQJ.Status.State != arbv1.AppWrapperStateCompleted && newQJ.Status.State != arbv1.AppWrapperStateFailed) && hasCompletionStatus {

0 commit comments

Comments
 (0)