@@ -130,6 +130,7 @@ func reconcileBpfApplication[T BpfProgOper, TL BpfProgListOper[T]](
130130 }
131131 }
132132
133+ pendingBpfApplications := []string {}
133134 failedBpfApplications := []string {}
134135 finalApplied := []string {}
135136 // Make sure no BpfApplications had any issues in the loading or unloading process
@@ -142,6 +143,8 @@ func reconcileBpfApplication[T BpfProgOper, TL BpfProgListOper[T]](
142143 status := bpfAppState .GetStatus ()
143144 if bpfmanHelpers .IsBpfAppStateConditionFailure (& status .Conditions ) {
144145 failedBpfApplications = append (failedBpfApplications , bpfAppState .GetName ())
146+ } else if bpfmanHelpers .IsBpfAppStateConditionPending (& status .Conditions ) {
147+ pendingBpfApplications = append (pendingBpfApplications , bpfAppState .GetName ())
145148 }
146149 }
147150
@@ -153,18 +156,17 @@ func reconcileBpfApplication[T BpfProgOper, TL BpfProgListOper[T]](
153156 return r .removeFinalizer (ctx , app , internal .BpfmanOperatorFinalizer )
154157 }
155158
156- // Causes Requeue
157159 return rec .updateStatus (ctx , appNamespace , appName , bpfmaniov1alpha1 .BpfAppCondDeleteError ,
158160 fmt .Sprintf ("Program Deletion failed on the following BpfApplicationState objects: %v" , finalApplied ))
159161 }
160162
161163 if len (failedBpfApplications ) != 0 {
162- // Causes Requeue
163164 return rec .updateStatus (ctx , appNamespace , appName , bpfmaniov1alpha1 .BpfAppCondError ,
164- fmt .Sprintf ("bpfProgramReconciliation failed on the following BpfApplicationState objects: %v" , failedBpfApplications ))
165+ fmt .Sprintf ("BpfApplication Reconciliation failed on the following BpfApplicationState objects: %v" , failedBpfApplications ))
166+ } else if len (pendingBpfApplications ) != 0 {
167+ return rec .updateStatus (ctx , appNamespace , appName , bpfmaniov1alpha1 .BpfAppCondPending ,
168+ fmt .Sprintf ("BpfApplication Reconciliation is pending on the following BpfApplicationState objects: %v" , pendingBpfApplications ))
165169 }
166-
167- // Causes Requeue
168170 return rec .updateStatus (ctx , appNamespace , appName , bpfmaniov1alpha1 .BpfAppCondSuccess , "" )
169171}
170172
0 commit comments