@@ -175,6 +175,22 @@ func TestComputeReadyCondition(t *testing.T) {
175175 expectedStatus : metav1 .ConditionFalse ,
176176 expectedReason : "DependenciesNotReady" ,
177177 },
178+ {
179+ name : "sandbox paused" ,
180+ sandbox : & sandboxv1alpha1.Sandbox {
181+ ObjectMeta : metav1.ObjectMeta {
182+ Generation : 1 ,
183+ },
184+ Status : sandboxv1alpha1.SandboxStatus {
185+ Phase : sandboxv1alpha1 .SandboxPhasePaused ,
186+ },
187+ },
188+ err : nil ,
189+ svc : & corev1.Service {},
190+ pod : nil ,
191+ expectedStatus : metav1 .ConditionTrue ,
192+ expectedReason : "DependenciesReady" ,
193+ },
178194 {
179195 name : "all not ready" ,
180196 sandbox : & sandboxv1alpha1.Sandbox {
@@ -227,6 +243,7 @@ func TestReconcile(t *testing.T) {
227243 },
228244 // Verify Sandbox status
229245 wantStatus : sandboxv1alpha1.SandboxStatus {
246+ Phase : sandboxv1alpha1 .SandboxPhasePending ,
230247 Service : sandboxName ,
231248 ServiceFQDN : "sandbox-name.sandbox-ns.svc.cluster.local" ,
232249 Replicas : 1 ,
@@ -320,6 +337,7 @@ func TestReconcile(t *testing.T) {
320337 },
321338 // Verify Sandbox status
322339 wantStatus : sandboxv1alpha1.SandboxStatus {
340+ Phase : sandboxv1alpha1 .SandboxPhasePending ,
323341 Service : sandboxName ,
324342 ServiceFQDN : "sandbox-name.sandbox-ns.svc.cluster.local" ,
325343 Replicas : 1 ,
@@ -406,6 +424,28 @@ func TestReconcile(t *testing.T) {
406424 },
407425 },
408426 },
427+ {
428+ name : "paused sandbox" ,
429+ sandboxSpec : sandboxv1alpha1.SandboxSpec {
430+ Replicas : ptr .To (int32 (0 )),
431+ },
432+ // Verify Sandbox status
433+ wantStatus : sandboxv1alpha1.SandboxStatus {
434+ Phase : sandboxv1alpha1 .SandboxPhasePaused ,
435+ Replicas : 0 ,
436+ ServiceFQDN : "sandbox-name.sandbox-ns.svc.cluster.local" ,
437+ Service : "sandbox-name" ,
438+ Conditions : []metav1.Condition {
439+ {
440+ Type : "Ready" ,
441+ Status : "True" ,
442+ ObservedGeneration : 1 ,
443+ Reason : "DependenciesReady" ,
444+ Message : "Sandbox is paused; Service Exists" ,
445+ },
446+ },
447+ },
448+ },
409449 }
410450
411451 for _ , tc := range testCases {
0 commit comments