// IsStageComplete returns true if all applications are Synced and Healthy
IsStageComplete returns true if all applications are Synced and Healthy
// IsStageComplete returns true if all applications are Synced and Healthy
func IsStageComplete(apps []argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage, pss utils.ProgressiveSyncState) bool {
	if apps == nil {
		return true
	}
	healthyApps := utils.GetAppsByHealthStatusCode(apps, health.HealthStatusHealthy)
	healthySyncedApps := utils.GetSyncedAppsByStage(healthyApps, stage, pss)
	appsToCompleteStage := pss.GetMaxTargets(stage)
	return len(healthySyncedApps) == appsToCompleteStage || appsToCompleteStage == 0
}
func IsStageComplete ( apps [ ] argov1alpha1 . Application , stage syncv1alpha1 . ProgressiveSyncStage , pss utils . ProgressiveSyncState ) bool { if apps == nil { return true } healthyApps := utils . GetAppsByHealthStatusCode ( apps , health . HealthStatusHealthy ) healthySyncedApps := utils . GetSyncedAppsByStage ( healthyApps , stage , pss ) appsToCompleteStage := pss . GetMaxTargets ( stage ) return len ( healthySyncedApps ) == appsToCompleteStage || appsToCompleteStage == 0 }
IsStageComplete returns true if all applications are Synced and Healthy
IsStageComplete returns true if all applications are Synced and Healthy
// An app is complete if: // - its Health Status Code is Healthy // - its Sync Status Code is Synced