Skip to content

Commit 2b3b099

Browse files
author
Jeff McCormick
committed
add primary flag to pgo show cluster output to show which pod is the primary
1 parent 17aa2a6 commit 2b3b099

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pgo/cmd/cluster.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,15 @@ func printCluster(detail *msgs.ShowClusterDetail) {
159159
fmt.Println("")
160160
fmt.Println("cluster : " + detail.Cluster.Spec.Name + " (" + detail.Cluster.Spec.CCPImageTag + ")")
161161

162+
var primaryStr string
162163
for _, pod := range detail.Pods {
163-
fmt.Println(TreeBranch + "pod : " + pod.Name + " (" + string(pod.Phase) + " on " + pod.NodeName + ") (" + pod.ReadyStatus + ")")
164+
if pod.Primary {
165+
primaryStr = "(primary)"
166+
} else {
167+
primaryStr = ""
168+
}
169+
podStr := fmt.Sprintf("%spod : %s (%s) on %s (%s) %s", TreeBranch, pod.Name, string(pod.Phase), pod.NodeName, pod.ReadyStatus, primaryStr)
170+
fmt.Println(podStr)
164171
for _, pvc := range pod.PVCName {
165172
fmt.Println(TreeBranch + "pvc : " + pvc)
166173
}

0 commit comments

Comments
 (0)