Skip to content

Commit 1de4ac5

Browse files
authored
chore(route): pretty At time display and add GRPCRoute
* chore(ps): pretty At time display * chore(routes): add GRPCRoute
1 parent 67ed5bc commit 1de4ac5

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

cmd/ps.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,13 @@ func (d *DryccCmd) PsDescribe(appID, podID string) error {
144144
for innerKey := range value {
145145
innerValue := strconv.Quote(fmt.Sprintf("%v", value[innerKey]))
146146
if innerKey == "startedAt" || innerKey == "finishedAt" {
147-
innerValue = d.formatTime(fmt.Sprintf("%s", value[innerKey]))
147+
if value[innerKey] != nil {
148+
innerValue = d.formatTime(fmt.Sprintf("%s", value[innerKey]))
149+
} else {
150+
innerValue = "null"
151+
}
148152
}
149-
table.Append([]string{fmt.Sprintf(" %s:", innerKey), innerValue})
153+
table.Append([]string{fmt.Sprintf(" %s:", innerKey), strings.Trim(innerValue, `"`)})
150154
}
151155
}
152156
// LastState
@@ -156,9 +160,13 @@ func (d *DryccCmd) PsDescribe(appID, podID string) error {
156160
for innerKey := range value {
157161
innerValue := strconv.Quote(fmt.Sprintf("%v", value[innerKey]))
158162
if innerKey == "startedAt" || innerKey == "finishedAt" {
159-
innerValue = d.formatTime(fmt.Sprintf("%s", value[innerKey]))
163+
if value[innerKey] != nil {
164+
innerValue = d.formatTime(fmt.Sprintf("%s", value[innerKey]))
165+
} else {
166+
innerValue = "null"
167+
}
160168
}
161-
table.Append([]string{fmt.Sprintf(" %s:", innerKey), innerValue})
169+
table.Append([]string{fmt.Sprintf(" %s:", innerKey), strings.Trim(innerValue, `"`)})
162170
}
163171
}
164172
table.Append([]string{"Ready:", fmt.Sprintf("%v", containerState.Ready)})

parser/routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Arguments:
6363
<type>
6464
the process type needs to create route.
6565
<kind>
66-
the route kind. Supports HTTPRoute, TCPRoute, UDPRoute, and TLSRoute.
66+
the route kind. Supports HTTPRoute, TCPRoute, UDPRoute, GRPCRoute, and TLSRoute.
6767
<port>
6868
the port that should be exposed by this service.
6969

0 commit comments

Comments
 (0)