Skip to content

Commit cd75c18

Browse files
authored
modify the initialization of ContainerResourceRecommendation (#203)
1 parent 75c5c6c commit cd75c18

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

controllers/tortoise_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ func (r *TortoiseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_
140140

141141
if tortoise.Status.TortoisePhase == autoscalingv1beta2.TortoisePhaseInitializing ||
142142
tortoise.Status.Recommendations.Vertical.ContainerResourceRecommendation == nil /* only the integration test */ {
143+
// Put the current resource requests into tortoise.Status.Recommendations.Vertical.ContainerResourceRecommendation.
144+
// Once we stop depending on deployments, we should put this logic in initializeTortoise.
145+
146+
tortoise.Status.Recommendations.Vertical.ContainerResourceRecommendation = nil // reset
143147
for _, c := range dm.Spec.Template.Spec.Containers {
144148
rcr := v1beta2.RecommendedContainerResources{
145149
ContainerName: c.Name,

0 commit comments

Comments
 (0)