@@ -694,6 +694,7 @@ func (r *Reconciler) VerifyNetworkAttachments(
694694 conditions * condition.Conditions ,
695695 networkAttachmentStatus * map [string ][]string ,
696696) (ctrl.Result , error ) {
697+ Log := r .GetLogger (ctx )
697698 pod , err := r .GetPodIfExists (ctx , instance , workflowStepIndex )
698699 if pod == nil {
699700 return ctrl.Result {}, err
@@ -718,14 +719,33 @@ func (r *Reconciler) VerifyNetworkAttachments(
718719 condition .NetworkAttachmentsReadyMessage )
719720 } else {
720721 err := fmt .Errorf ("%w: %s" , ErrNetworkAttachmentsMismatch , networkAttachments )
722+
723+ // maxWaitTime to wait for NAD that should escalate to a hard error
724+ const maxWaitTime = 5 * time .Minute
725+ elaspedTime := time .Since (pod .GetCreationTimestamp ().Time )
726+ if elaspedTime > maxWaitTime {
727+ conditions .Set (condition .FalseCondition (
728+ condition .NetworkAttachmentsReadyCondition ,
729+ condition .ErrorReason ,
730+ condition .SeverityError ,
731+ condition .NetworkAttachmentsReadyErrorMessage ,
732+ fmt .Errorf ("timed out waiting for network attachments: %w" , err ).Error ()))
733+
734+ return ctrl.Result {}, err
735+ }
736+
721737 conditions .Set (condition .FalseCondition (
722738 condition .NetworkAttachmentsReadyCondition ,
723- condition . ErrorReason ,
739+ "NetworkAttachmentsWaiting" ,
724740 condition .SeverityWarning ,
725741 condition .NetworkAttachmentsReadyErrorMessage ,
726742 err .Error ()))
727743
728- return ctrl.Result {}, err
744+ Log .Info ("Waiting for network attachments to become ready" ,
745+ "elaspedTime" , elaspedTime ,
746+ "maxWaitTime" , maxWaitTime )
747+
748+ return ctrl.Result {RequeueAfter : time .Second * 10 }, nil
729749 }
730750
731751 return ctrl.Result {}, nil
0 commit comments