Skip to content

Commit

Permalink
Break comment line
Browse files Browse the repository at this point in the history
  • Loading branch information
maruina committed Feb 26, 2021
1 parent b68847e commit 8932359
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions internal/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,26 @@ import (
func Scheduler(apps []argov1alpha1.Application, stage deploymentskyscannernetv1alpha1.ProgressiveRolloutStage) []string {

/*
The Scheduler takes
- a ProgressiveRolloutStage object
- the Applications selected with the clusters selector
The Scheduler takes
- a ProgressiveRolloutStage object
- the Applications selected with the clusters selector
The Scheduler splits the Applications in the following groups:
- OutOfSync Applications: those are the Applications to update during the stage.
- syncedInCurrentStage Applications: those are Application that synced during the current stage. Those Applications count against the number of clusters to update.
- progressingApps: those are Applications that are still in progress updating. Those Applications count against the number of clusters to update in parallel.
The Scheduler splits the Applications in the following groups:
- OutOfSync Applications: those are the Applications to update during the stage.
- syncedInCurrentStage Applications: those are Application that synced during the current stage. Those Applications count against the number of clusters to update.
- progressingApps: those are Applications that are still in progress updating. Those Applications count against the number of clusters to update in parallel.
Why does the Scheduler need an annotation? Consider the scenario where we have 5 Applications - 4 OutOfSync and 1 Synced - and a stage with maxTargets = 3.
If we don't keep track on which stage the Application synced, we can't compute how many applications we have to update in the current stage. Without the annotation, it would be impossible for the scheduler to know if the Application synced at this stage - and so we have only 2 Applications left to sync.
Why does the Scheduler need an annotation? Consider the scenario where we have 5 Applications - 4 OutOfSync and 1 Synced - and a stage with maxTargets = 3.
If we don't keep track on which stage the Application synced, we can't compute how many applications we have to update in the current stage.
Without the annotation, it would be impossible for the scheduler to know if the Application synced at this stage - and so we have only 2 Applications left to sync.
*/

var scheduledApps []string

outOfSyncApps := utils.GetAppsBySyncStatusCode(apps, argov1alpha1.SyncStatusCodeOutOfSync)

// If there are no OutOfSync Applications, return
if len(outOfSyncApps) <= 0 {
if len(outOfSyncApps) == 0 {
return scheduledApps
}

Expand Down

0 comments on commit 8932359

Please sign in to comment.