Skip to content

Commit 2e27c49

Browse files
committed
Default to down when defaulting to unknown [sc-15808]
When resources are overburdened, 'pgo test cluster' will show a pod to be 'unknown' and UP, while kubectl get pods will show a pending status. The pod is not actually up under these conditions, so when we default to labeling a pod as unknown, before it can be classified as a primary or replica, we should also classify the pod as DOWN.
1 parent 7c10511 commit 2e27c49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/apiserver/clusterservice/clusterimpl.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT
377377
log.Debugf("Total clusters found: %d", len(clusterList.Items))
378378

379379
// Iterate through each cluster and perform the various tests against them
380-
for i := range clusterList.Items {
381-
c := clusterList.Items[i]
380+
for _, c := range clusterList.Items {
382381
// Set up the object that will be appended to the response that
383382
// indicates the availability of the endpoints / instances for this
384383
// cluster
@@ -440,6 +439,7 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT
440439
switch pod.Type {
441440
default:
442441
instance.InstanceType = msgs.ClusterTestInstanceTypeUnknown
442+
instance.Available = false
443443
case msgs.PodTypePrimary:
444444
instance.InstanceType = msgs.ClusterTestInstanceTypePrimary
445445
case msgs.PodTypeReplica:
@@ -469,7 +469,7 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT
469469
}
470470

471471
// Iterate through the services and determine if they are reachable via
472-
// their endpionts
472+
// their endpoints
473473
for _, service := range detail.Services {
474474
// prepare the endpoint request
475475
endpointRequest := &kubeapi.GetEndpointRequest{

0 commit comments

Comments
 (0)