Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the problem where old PAs go into unknown state. #3836

Merged
merged 1 commit into from
Apr 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/reconciler/v1alpha1/autoscaling/kpa/kpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ func (c *Reconciler) reconcile(ctx context.Context, pa *pav1alpha1.PodAutoscaler
if err != nil {
return perrors.Wrapf(err, "error checking endpoints %s", sks.Status.PrivateServiceName)
}
logger.Infof("PA scale got=%v, want=%v", got, want)
}
logger.Infof("PA scale got=%v, want=%v", got, want)

err = reportMetrics(pa, want, got)
if err != nil {
Expand Down Expand Up @@ -444,14 +444,16 @@ func computeActiveCondition(pa *pav1alpha1.PodAutoscaler, want int32, got int) (
ret = !pa.Status.IsInactive() // Any state but inactive should change SKS.
pa.Status.MarkInactive("NoTraffic", "The target is not receiving traffic.")

case got == 0 && want != 0:
case got == 0 && want > 0:
ret = pa.Status.IsInactive() // If we were inactive and became activating.
pa.Status.MarkActivating(
"Queued", "Requests to the target are being buffered as resources are provisioned.")

case got > 0:
// SKS should already be active.
pa.Status.MarkActive()
case want == scaleUnknown:
// We don't know what scale we want, so don't touch PA at all.
}

pa.Status.ObservedGeneration = pa.Generation
Expand Down