From 5019d37acc8f1fd4c6587f811347a269c4f24805 Mon Sep 17 00:00:00 2001 From: MohammedAbdi Date: Thu, 1 Aug 2024 12:06:47 -0400 Subject: [PATCH] set energy to constant Signed-off-by: MohammedAbdi --- internal/controller/labelgroup_controller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/controller/labelgroup_controller.go b/internal/controller/labelgroup_controller.go index d122ec1..a1cce0b 100644 --- a/internal/controller/labelgroup_controller.go +++ b/internal/controller/labelgroup_controller.go @@ -225,7 +225,8 @@ func (r *LabelGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) // - In the set of new containers, remove all containers that are active for containerId, oldValue := range labelGroup.Status.ActiveContainerIds { if newValue, found := metricValues[containerId]; found { - totalEnergy += (newValue - oldValue) + // totalEnergy += (newValue - oldValue) //put back + totalEnergy = 100 // testing purpose - remove after labelGroup.Status.ActiveContainerIds[containerId] = newValue delete(metricValues, containerId) } else { @@ -238,8 +239,7 @@ func (r *LabelGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) // 3) Add the values of the remaining new containers to the total energy and update the list of active containers for containerId, newValue := range metricValues { - // totalEnergy += newValue - totalEnergy = 100 + totalEnergy += newValue labelGroup.Status.ActiveContainerIds[containerId] = newValue }