Fix fn test failed to query logs from log database (#1401)
When `fn test` failed to retrieve logs from the function pod, it turns to query logs from the log database. However, the logdb type flag is not set to `fn test`, hence the logdb type is empty (even without default value) and cause `fn logs` returns an error due to unable to find the corresponding log database type. This PR adds logdb type flag to `fn test` to resolve the problem.
This commit is contained in:
@@ -119,13 +119,13 @@ func (opts *TestSubCommand) do(input cli.Input) error {
|
||||
|
||||
if resp.StatusCode < 400 {
|
||||
fmt.Print(string(body))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
fmt.Printf("Error calling function %s: %d; Please try again or fix the error: %s", m.Name, resp.StatusCode, string(body))
|
||||
err = printPodLogs(input)
|
||||
if err != nil {
|
||||
fmt.Printf("Error getting function logs from pod: %v. Try to get logs from log database", err)
|
||||
return Log(input)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user