Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions controllers/sandbox_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ func (r *SandboxReconciler) handleSandboxExpiry(ctx context.Context, sandbox *sa
allErrors = errors.Join(allErrors, fmt.Errorf("failed to delete service: %w", err))
}

// Clear all status fields explicitly
sandbox.Status = sandboxv1alpha1.SandboxStatus{}
// Update status to remove Ready condition
meta.SetStatusCondition(&sandbox.Status.Conditions, metav1.Condition{
Type: string(sandboxv1alpha1.SandboxConditionReady),
Expand All @@ -431,9 +433,6 @@ func (r *SandboxReconciler) handleSandboxExpiry(ctx context.Context, sandbox *sa
Message: "Sandbox has expired",
})

sandbox.Status.Replicas = 0
sandbox.Status.LabelSelector = ""

return allErrors
}

Expand Down
6 changes: 3 additions & 3 deletions test/e2e/shutdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func TestSandboxShutdownTime(t *testing.T) {
// Wait for sandbox status to reflect new state
p = []predicates.ObjectPredicate{
predicates.SandboxHasStatus(sandboxv1alpha1.SandboxStatus{
// TODO: should Service/ServiceFQDN be cleared from status when the Service is deleted?
Service: "my-sandbox",
ServiceFQDN: "my-sandbox.my-sandbox-ns.svc.cluster.local",
// Service/ServiceFQDN should be cleared from status when the Service is deleted
Service: "",
ServiceFQDN: "",
Replicas: 0,
Conditions: []metav1.Condition{
{
Expand Down