Skip to content

Commit cff413d

Browse files
committed
cluster: fixed last pod choosing method
sort pods by name ascending when choosing last pod from the slice
1 parent 6363181 commit cff413d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/cassandracluster/cassandra_status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ func (rcc *CassandraClusterReconciler) UpdateCassandraRackStatusPhase(ctx contex
474474
return
475475
}
476476
//If yes, just check that lastPod is running
477-
podsList, err := rcc.ListPods(ctx, cc.Namespace, k8s.LabelsForCassandraDCRack(cc, dcName, rackName))
477+
podsList, err := rcc.ListPodsOrderByNameAscending(ctx, cc.Namespace, k8s.LabelsForCassandraDCRack(cc, dcName, rackName))
478478
if err != nil || len(podsList.Items) < 1 {
479479
return
480480
}

0 commit comments

Comments
 (0)