Skip to content

Commit 4fb563a

Browse files
committed
chore(routes): change field order
1 parent c1bdd41 commit 4fb563a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cmd/routes.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (d *DryccCmd) RoutesList(appID string, results int) error {
4949
if count == 0 {
5050
d.Println(fmt.Sprintf("No routes found in %s app.", appID))
5151
} else {
52-
table := d.getDefaultFormatTable([]string{"NAME", "OWNER", "KIND", "SERVICE", "GATEWAY"})
52+
table := d.getDefaultFormatTable([]string{"NAME", "OWNER", "KIND", "GATEWAY", "SERVICE"})
5353
for _, route := range routes {
5454
var services []string
5555
for _, rule := range route.Rules {
@@ -69,8 +69,8 @@ func (d *DryccCmd) RoutesList(appID string, results int) error {
6969
route.Name,
7070
route.Owner,
7171
route.Kind,
72-
strings.Join(services, "\n"),
73-
strings.Join(gateways, "\n"),
72+
safeGetString(strings.Join(gateways, "\n")),
73+
safeGetString(strings.Join(services, "\n")),
7474
})
7575
}
7676
table.Render()

cmd/routes_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ func TestRoutesList(t *testing.T) {
103103
err = cmdr.RoutesList("foo", -1)
104104
assert.NoError(t, err)
105105

106-
assert.Equal(t, b.String(), `NAME OWNER KIND SERVICE GATEWAY
107-
example-go test HTTPRoute yygl-nextcloud:80 example-go:80
108-
yygl-nextcloud:8080 example-go:8080
106+
assert.Equal(t, b.String(), `NAME OWNER KIND GATEWAY SERVICE
107+
example-go test HTTPRoute example-go:80 yygl-nextcloud:80
108+
example-go:8080 yygl-nextcloud:8080
109109
`, "output")
110110
}
111111

0 commit comments

Comments
 (0)