fission function logs returns logs in correct order now (#405)

Fix a bug in `fission function logs` due to which logs with the same timestamp were printed in the wrong order.
This commit is contained in:
prithviramesh
2017-11-22 18:05:49 -08:00
committed by Soam Vasani
parent 04531850d5
commit 2247d3118a
4 changed files with 38 additions and 11 deletions
+10 -4
View File
@@ -444,6 +444,11 @@ func fnLogs(c *cli.Context) error {
Namespace: metav1.NamespaceDefault,
}
recordLimit := c.Int("recordcount")
if recordLimit <= 0 {
recordLimit = 1000
}
f, err := client.FunctionGet(m)
checkErr(err, "get function")
@@ -463,10 +468,11 @@ func fnLogs(c *cli.Context) error {
select {
case <-requestChan:
logFilter := logdb.LogFilter{
Pod: fnPod,
Function: f.Metadata.Name,
FuncUid: string(f.Metadata.UID),
Since: t,
Pod: fnPod,
Function: f.Metadata.Name,
FuncUid: string(f.Metadata.UID),
Since: t,
RecordLimit: recordLimit,
}
logEntries, err := logDB.GetLogs(logFilter)
if err != nil {