diff --git a/pkg/reconciler/serverlessservice/serverlessservice.go b/pkg/reconciler/serverlessservice/serverlessservice.go index b53ff456149f..b3c39a50b5db 100644 --- a/pkg/reconciler/serverlessservice/serverlessservice.go +++ b/pkg/reconciler/serverlessservice/serverlessservice.go @@ -292,7 +292,8 @@ func (r *reconciler) reconcilePublicEndpoints(ctx context.Context, sks *netv1alp } // If we have no backends or if we're in the proxy mode, then // activator backs this revision. - if !foundServingEndpoints || mode == netv1alpha1.SKSOperationModeProxy { + // If no activator, force serve mode and remove. + if mode == netv1alpha1.SKSOperationModeProxy { sks.Status.MarkActivatorEndpointsPopulated() } else { sks.Status.MarkActivatorEndpointsRemoved() diff --git a/pkg/reconciler/serverlessservice/serverlessservice_test.go b/pkg/reconciler/serverlessservice/serverlessservice_test.go index d415f1121b64..e250c97c58c8 100644 --- a/pkg/reconciler/serverlessservice/serverlessservice_test.go +++ b/pkg/reconciler/serverlessservice/serverlessservice_test.go @@ -447,7 +447,7 @@ func TestReconcile(t *testing.T) { Name: "OnCreate-no-activator-eps-proxy", Key: "on/cnaeps", Objects: []runtime.Object{ - SKS("on", "cnaeps", WithDeployRef("blah"), withProxyMode), + SKS("on", "cnaeps", WithDeployRef("blah"), WithProxyMode), deploy("on", "blah"), endpointspriv("on", "cnaeps"), // This should be ignored. activatorEndpoints(), @@ -458,8 +458,8 @@ func TestReconcile(t *testing.T) { endpointspub("on", "cnaeps"), }, WantStatusUpdates: []clientgotesting.UpdateActionImpl{{ - Object: SKS("on", "cnaeps", WithDeployRef("blah"), withProxyMode, - markNoEndpoints, WithPubService, WithPrivateService), + Object: SKS("on", "cnaeps", WithDeployRef("blah"), WithProxyMode, + markNoHealthyEndpoints, WithPubService, WithPrivateService), }}, }, { Name: "create-svc-fail-priv", @@ -768,12 +768,12 @@ func markTransitioning(s string) SKSOption { } func markNoEndpoints(sks *nv1a1.ServerlessService) { - sks.Status.MarkEndpointsNotReady("NoHealthyBackends") + markNoHealthyEndpoints(sks) sks.Status.MarkActivatorEndpointsPopulated() } -func markNoActivatorEndpoints(sks *nv1a1.ServerlessService) { - sks.Status.MarkActivatorEndpointsRemoved() +func markNoHealthyEndpoints(sks *nv1a1.ServerlessService) { + sks.Status.MarkEndpointsNotReady("NoHealthyBackends") } func withHTTP2Protocol(sks *nv1a1.ServerlessService) {