Skip to content

Commit

Permalink
Add comment for handling scale to zero while no activator endpoints (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yenniechen committed May 31, 2024
1 parent 37fe895 commit 075925f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/reconciler/autoscaling/kpa/scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ func (ks *scaler) handleScaleToZero(ctx context.Context, pa *autoscalingv1alpha1
// Compute the difference between time we've been proxying with the timeout.
// If it's positive, that's the time we need to sleep, if negative -- we
// can scale to zero.
// It is positive if no activator endpoints, because the condition with type name
// "ActivatorEndpointsPopulated" will be false or nil.
// We can not scale to zero when no activator endpoints.
pf := sks.Status.ProxyFor()
to := cfgAS.ScaleToZeroGracePeriod - pf
if to <= 0 {
Expand Down

0 comments on commit 075925f

Please sign in to comment.