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:
@@ -138,7 +138,11 @@ func Commands() *cobra.Command {
|
||||
wrapper.SetFlags(testCmd, flag.FlagSet{
|
||||
Required: []flag.Flag{flag.FnName},
|
||||
Optional: []flag.Flag{flag.HtMethod, flag.FnTestHeader, flag.FnTestBody,
|
||||
flag.FnTestQuery, flag.FnTestTimeout, flag.NamespaceFunction},
|
||||
flag.FnTestQuery, flag.FnTestTimeout, flag.NamespaceFunction,
|
||||
// for getting log from log database if
|
||||
// we failed to get logs from function pod.
|
||||
flag.FnLogDBType,
|
||||
},
|
||||
})
|
||||
|
||||
command := &cobra.Command{
|
||||
|
||||
Reference in New Issue
Block a user