Skip to content

Commit

Permalink
set energy to constant
Browse files Browse the repository at this point in the history
Signed-off-by: MohammedAbdi <[email protected]>
  • Loading branch information
mamy-CS committed Aug 1, 2024
1 parent da5abb0 commit 5019d37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/controller/labelgroup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}

Expand Down

0 comments on commit 5019d37

Please sign in to comment.