tadayosi commented on code in PR #3589:
URL: https://github.com/apache/camel-k/pull/3589#discussion_r962551805
##########
pkg/cmd/log.go:
##########
@@ -129,7 +134,13 @@ func (o *logCmdOptions) run(cmd *cobra.Command, args
[]string) error {
// Found the running integration so step over to
scraping its pod log
//
fmt.Fprintln(cmd.OutOrStdout(), "Integration
'"+integrationID+"' is now running. Showing log ...")
- if err := k8slog.Print(o.Context, cmd, c, &integration,
cmd.OutOrStdout()); err != nil {
+ var tailLines *int64
+ if cmd.Flags().Lookup("tail-lines").Changed {
+ tailLines = &o.TailLines
+ } else if o.Tail {
+ tailLines = &[]int64{10}[0]
+ }
Review Comment:
When `o.TailLines` is explicitly defaulted to `10`, do we really need this
`if`? Also, if we do, you should use `pointer.Into64(10)` here:
```
tailLines = &[]int64{10}[0]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]