From 89323591c195e6e135aba8e7d111069f82bc1762 Mon Sep 17 00:00:00 2001 From: Matteo Ruina Date: Fri, 26 Feb 2021 14:39:33 +0100 Subject: [PATCH] Break comment line --- internal/scheduler/scheduler.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/internal/scheduler/scheduler.go b/internal/scheduler/scheduler.go index 6b04648f..bbe22ad9 100644 --- a/internal/scheduler/scheduler.go +++ b/internal/scheduler/scheduler.go @@ -12,17 +12,18 @@ 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 @@ -30,7 +31,7 @@ func Scheduler(apps []argov1alpha1.Application, stage deploymentskyscannernetv1a outOfSyncApps := utils.GetAppsBySyncStatusCode(apps, argov1alpha1.SyncStatusCodeOutOfSync) // If there are no OutOfSync Applications, return - if len(outOfSyncApps) <= 0 { + if len(outOfSyncApps) == 0 { return scheduledApps }