Skip to content

Commit 656dcb6

Browse files
authored
feat(ps): pod list add ready and restarts (#30)
1 parent 9ed47aa commit 656dcb6

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

api/ps.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ type ProcessType map[string]string
1010

1111
// Pods defines the structure of a process.
1212
type Pods struct {
13-
Release string `json:"release"`
14-
Type string `json:"type"`
15-
Name string `json:"name"`
16-
State string `json:"state"`
17-
Started time.Time `json:"started"`
13+
Release string `json:"release"`
14+
Type string `json:"type"`
15+
Name string `json:"name"`
16+
State string `json:"state"`
17+
Ready string `json:"ready"`
18+
Restarts int `json:"restarts"`
19+
Started time.Time `json:"started"`
1820
}
1921

2022
// PodsList defines a collection of app pods.

api/ps_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99

1010
func TestPodsListSorted(t *testing.T) {
1111
pods := PodsList{
12-
{"", "web", "web.fsdfgh4", "up", time.Time{}},
13-
{"", "web", "web.asdfgh1", "up", time.Time{}},
14-
{"", "web", "web.csdfgh3", "up", time.Time{}},
15-
{"", "web", "web.bsdfgh2", "up", time.Time{}},
12+
{"", "web", "web.fsdfgh4", "up", "1/1", 0, time.Time{}},
13+
{"", "web", "web.asdfgh1", "up", "1/1", 0, time.Time{}},
14+
{"", "web", "web.csdfgh3", "up", "1/1", 0, time.Time{}},
15+
{"", "web", "web.bsdfgh2", "up", "1/1", 0, time.Time{}},
1616
}
1717

1818
sort.Sort(pods)

0 commit comments

Comments
 (0)