@@ -224,7 +224,7 @@ func (r *ApplicationSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque
224224 appMap [app .Name ] = app
225225 }
226226
227- appSyncMap , err = r .performProgressiveSyncs (ctx , logCtx , applicationSetInfo , currentApplications , desiredApplications , appMap )
227+ appSyncMap , err = r .performProgressiveSyncs (ctx , logCtx , & applicationSetInfo , currentApplications , desiredApplications , appMap )
228228 if err != nil {
229229 return ctrl.Result {}, fmt .Errorf ("failed to perform progressive sync reconciliation for application set: %w" , err )
230230 }
@@ -854,10 +854,10 @@ func (r *ApplicationSetReconciler) removeOwnerReferencesOnDeleteAppSet(ctx conte
854854 return nil
855855}
856856
857- func (r * ApplicationSetReconciler ) performProgressiveSyncs (ctx context.Context , logCtx * log.Entry , appset argov1alpha1.ApplicationSet , applications []argov1alpha1.Application , desiredApplications []argov1alpha1.Application , appMap map [string ]argov1alpha1.Application ) (map [string ]bool , error ) {
858- appDependencyList , appStepMap := r .buildAppDependencyList (logCtx , appset , desiredApplications )
857+ func (r * ApplicationSetReconciler ) performProgressiveSyncs (ctx context.Context , logCtx * log.Entry , appset * argov1alpha1.ApplicationSet , applications []argov1alpha1.Application , desiredApplications []argov1alpha1.Application , appMap map [string ]argov1alpha1.Application ) (map [string ]bool , error ) {
858+ appDependencyList , appStepMap := r .buildAppDependencyList (logCtx , * appset , desiredApplications )
859859
860- _ , err := r .updateApplicationSetApplicationStatus (ctx , logCtx , & appset , applications , appStepMap )
860+ _ , err := r .updateApplicationSetApplicationStatus (ctx , logCtx , appset , applications , appStepMap )
861861 if err != nil {
862862 return nil , fmt .Errorf ("failed to update applicationset app status: %w" , err )
863863 }
@@ -867,15 +867,15 @@ func (r *ApplicationSetReconciler) performProgressiveSyncs(ctx context.Context,
867867 logCtx .Infof ("step %v: %+v" , i + 1 , step )
868868 }
869869
870- appSyncMap := r .buildAppSyncMap (appset , appDependencyList , appMap )
870+ appSyncMap := r .buildAppSyncMap (* appset , appDependencyList , appMap )
871871 logCtx .Infof ("Application allowed to sync before maxUpdate?: %+v" , appSyncMap )
872872
873- _ , err = r .updateApplicationSetApplicationStatusProgress (ctx , logCtx , & appset , appSyncMap , appStepMap )
873+ _ , err = r .updateApplicationSetApplicationStatusProgress (ctx , logCtx , appset , appSyncMap , appStepMap )
874874 if err != nil {
875875 return nil , fmt .Errorf ("failed to update applicationset application status progress: %w" , err )
876876 }
877877
878- _ = r .updateApplicationSetApplicationStatusConditions (ctx , & appset )
878+ _ = r .updateApplicationSetApplicationStatusConditions (ctx , appset )
879879
880880 return appSyncMap , nil
881881}
@@ -1416,6 +1416,9 @@ func (r *ApplicationSetReconciler) syncValidApplications(logCtx *log.Entry, appl
14161416 appSetStatusPending = true
14171417 }
14181418
1419+ logCtx .Debugf ("ApplicationSet trigger" )
1420+ logCtx .Debugf ("%#v" , applicationSet .Status .ApplicationStatus [idx ])
1421+
14191422 // check appSyncMap to determine which Applications are ready to be updated and which should be skipped
14201423 if appSyncMap [validApps [i ].Name ] && appMap [validApps [i ].Name ].Status .Sync .Status == "OutOfSync" && appSetStatusPending {
14211424 logCtx .Infof ("triggering sync for application: %v, prune enabled: %v" , validApps [i ].Name , pruneEnabled )
0 commit comments