-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: extending filtering options #52
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @slayer321. Few comments:
- Avoid code duplication
- Compile the regex just once
- Add unit tests
log/logClient.go
Outdated
@@ -204,6 +205,39 @@ func (fd *Feeder) WatchAlerts(logPath string, jsonFormat bool) error { | |||
break | |||
} | |||
|
|||
if namespace != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments:
- Compile has to be done just once... not on every event.
- avoid code duplication
- add some unit tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, Looks like a great start 😄
Left some comments in addition to what @nyrahul suggested.
logCmd.Flags().StringVar(&logOptions.ContainerName, "containerName", "", "name of the container ") | ||
logCmd.Flags().StringVar(&logOptions.PodName, "podName", "", "name of the pod ") | ||
logCmd.Flags().StringVar(&logOptions.Resource, "resource", "", "command used by the user") | ||
logCmd.Flags().StringVar(&logOptions.Source, "source", "", "binary used by the system ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resource
and source
usage might not be correct ...
correct me with that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the values/names of particular fields can only be in lower case then it should be fine to make the regex match case insensitive for them since it wouldn't matter what case we provide in filter, the resultant value is only in one case. Does this make sense?
Left some more comments in the review. Thank You.
Hey @daemon1024, I have made the required changes. Do check and let me know your feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Work 👌🏽 Can you handle the linter errors (w.r.t your changes) and squash the commits. Thank You
I'm not able to see any linter error ... It is showing |
@slayer321 linter warnings* |
Signed-off-by: slayer321 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. LGTM.
Signed-off-by: slayer321 [email protected]
Add 7 filtering options
related issue #40
cc @nyrahul @daemon1024