Skip to content

Commit

Permalink
do not mark activator populated when neither revision nor activator h…
Browse files Browse the repository at this point in the history
…as endpoints (#15278)
  • Loading branch information
yenniechen committed May 31, 2024
1 parent 075925f commit 8c77066
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion pkg/reconciler/serverlessservice/serverlessservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 6 additions & 6 deletions pkg/reconciler/serverlessservice/serverlessservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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",
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8c77066

Please sign in to comment.