diff --git a/internal/controller/labelgroup_controller.go b/internal/controller/labelgroup_controller.go index e3367e3..3cf4c63 100644 --- a/internal/controller/labelgroup_controller.go +++ b/internal/controller/labelgroup_controller.go @@ -230,9 +230,9 @@ 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) //put back - r.Logger.V(5).Info(fmt.Sprintf("[Reconcile-Aggregating] oldValue: %#v", oldValue)) - totalEnergy = 100 // testing purpose - remove after + totalEnergy += (newValue - oldValue) + r.Logger.V(5).Info(fmt.Sprintf("[Reconcile-Aggregating] newValue: %#v", newValue)) // trace + r.Logger.V(5).Info(fmt.Sprintf("[Reconcile-Aggregating] oldValue: %#v", oldValue)) // trace labelGroup.Status.ActiveContainerIds[containerId] = newValue delete(metricValues, containerId) } else {