Skip to content

Commit ea7f72f

Browse files
committed
add break condition
1 parent f0def34 commit ea7f72f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/controller/queuejob/queuejob_controller_ex.go

+4
Original file line numberDiff line numberDiff line change
@@ -1698,6 +1698,10 @@ func (cc *XController) updateQueueJob(oldObj, newObj interface{}) {
16981698
for {
16991699
time.Sleep(requeueInterval)
17001700
latestAw, exists, err := cc.appwrapperInformer.Informer().GetStore().GetByKey(key)
1701+
if latestAw.(*arbv1.AppWrapper).Status.State == arbv1.AppWrapperStateCompleted || latestAw.(arbv1.AppWrapper).Status.State == arbv1.AppWrapperStateFailed || latestAw.(arbv1.AppWrapper).Status.State == arbv1.AppWrapperStateDeleted {
1702+
klog.V(2).Infof("[Informer-updateQJ] Stopping requeue for AW %s with status %s", latestAw.(*arbv1.AppWrapper).Name, latestAw.(*arbv1.AppWrapper).Status.State)
1703+
break
1704+
}
17011705
if err == nil && exists {
17021706
// Enqueue the latest copy of the AW.
17031707
if (newQJ.Status.State != arbv1.AppWrapperStateCompleted && newQJ.Status.State != arbv1.AppWrapperStateFailed) && hasCompletionStatus {

0 commit comments

Comments
 (0)