MCPcopy Index your code
hub / github.com/cortexlabs/cortex / replicaCountTable

Function replicaCountTable

cli/cmd/lib_apis.go:24–59  ·  view source on GitHub ↗
(counts *status.ReplicaCounts)

Source from the content-addressed store, hash-verified

22)
23
24func replicaCountTable(counts *status.ReplicaCounts) table.Table {
25 var rows [][]interface{}
26 for _, replicaCountType := range status.ReplicaCountTypes {
27 count := counts.GetCountBy(replicaCountType)
28 canBeHiddenIfZero := false
29 switch replicaCountType {
30 case status.ReplicaCountFailed:
31 canBeHiddenIfZero = true
32 case status.ReplicaCountKilled:
33 canBeHiddenIfZero = true
34 case status.ReplicaCountKilledOOM:
35 canBeHiddenIfZero = true
36 case status.ReplicaCountErrImagePull:
37 canBeHiddenIfZero = true
38 case status.ReplicaCountUnknown:
39 canBeHiddenIfZero = true
40 case status.ReplicaCountStalled:
41 canBeHiddenIfZero = true
42 }
43 if count == 0 && canBeHiddenIfZero {
44 continue
45 }
46 rows = append(rows, []interface{}{
47 replicaCountType,
48 count,
49 })
50 }
51
52 return table.Table{
53 Headers: []table.Header{
54 {Title: _titleReplicaStatus, MinWidth: 32, MaxWidth: 32},
55 {Title: _titleReplicaCount},
56 },
57 Rows: rows,
58 }
59}

Callers 2

realtimeDescribeAPITableFunction · 0.85
asyncDescribeAPITableFunction · 0.85

Calls 1

GetCountByMethod · 0.80

Tested by

no test coverage detected