From 1a13f7baa915a456527a4940a102dba1a9827497 Mon Sep 17 00:00:00 2001 From: Sascha Schwarze Date: Mon, 21 Aug 2023 13:58:41 +0200 Subject: [PATCH] Ensure old revision stays Unreachable after Knative Service update Directly check the ServerlessService Ready condition instead of its IsReady condition so that we do not see a temporary false when its generation is changing. Signed-off-by: Sascha Schwarze --- pkg/reconciler/autoscaling/kpa/kpa.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/reconciler/autoscaling/kpa/kpa.go b/pkg/reconciler/autoscaling/kpa/kpa.go index 013022d2df49..aaf337728491 100644 --- a/pkg/reconciler/autoscaling/kpa/kpa.go +++ b/pkg/reconciler/autoscaling/kpa/kpa.go @@ -167,7 +167,8 @@ func (c *Reconciler) ReconcileKind(ctx context.Context, pa *autoscalingv1alpha1. pa.Status.ServiceName = sks.Status.ServiceName // If SKS is not ready — ensure we're not becoming ready. - if sks.IsReady() { + // Do not use ServerlessService.IsReady() here because this flips to not ready when the generation changes. + if sks.Status.GetCondition(nv1alpha1.ServerlessServiceConditionReady).IsTrue() { logger.Debug("SKS is ready, marking SKS status ready") pa.Status.MarkSKSReady() } else {