Skip to content

Commit cc6f70f

Browse files
committed
Remove delay in scaling API replicas
1 parent e2ff778 commit cc6f70f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/operator/workloads/api_workload.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,13 @@ func serviceSpec(ctx *context.Context, api *context.API) *kcore.Service {
473473
})
474474
}
475475

476-
func doesAPIComputeNeedsUpdating(api *context.API, deployment *kapps.Deployment) bool {
477-
curCPU, curMem, curGPU := APIPodCompute(deployment.Spec.Template.Spec.Containers)
476+
func doesAPIComputeNeedsUpdating(api *context.API, k8sDeployment *kapps.Deployment) bool {
477+
requestedReplicas := getRequestedReplicasFromDeployment(api, k8sDeployment, nil)
478+
if k8sDeployment.Spec.Replicas == nil || *k8sDeployment.Spec.Replicas != requestedReplicas {
479+
return true
480+
}
481+
482+
curCPU, curMem, curGPU := APIPodCompute(k8sDeployment.Spec.Template.Spec.Containers)
478483
if !userconfig.QuantityPtrsEqual(curCPU, &api.Compute.CPU) {
479484
return true
480485
}

0 commit comments

Comments
 (0)