Skip to content
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

k8s: remove unused filter functionality from k8sclient.CiliumLogs #2501

Conversation

mhofstetter
Copy link
Member

@mhofstetter mhofstetter commented Apr 24, 2024

Currently, the logic to retrieve all logs from Cilium Pods is implemented using bufio.Scanner. This might result in errors for long loglines - hiding the actual error.

Error reading Cilium logs: error reading cilium-agent logs for kube-system/cilium-c2sx7: bufio.Scanner: token too long

AFAIU, the only reason to use the bufio.Scanner is the support for filtering the logs by a given regular expression. But this functionality is not used.

Therefore, this commit removes the filter functionality and the usage of bufio.Scanner.

Currently, the logic to retrieve all logs from Cilium Pods is implemented using
`bufio.Scanner`. This might result in errors for long  loglines.

```
Error reading Cilium logs: error reading cilium-agent logs for kube-system/cilium-c2sx7: bufio.Scanner: token too long
```

The only reason to use the `bufio.Scanner` is the support to filter the logs by
a given regular expression. But this functionality is not used.

Therefore, this commit removes the filter functionality and the usage of `bufio.Scanner`.

Signed-off-by: Marco Hofstetter <[email protected]>
@mhofstetter mhofstetter force-pushed the pr/mhofstetter/ciliumlogs-without-filter-and-scanner branch from 052a903 to 0c7c9cf Compare April 25, 2024 06:42
@mhofstetter mhofstetter marked this pull request as ready for review April 25, 2024 08:14
@mhofstetter mhofstetter requested review from a team as code owners April 25, 2024 08:14
Copy link
Member

@nebril nebril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Member

@asauber asauber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more red than green, very good

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Apr 30, 2024
@tklauser tklauser merged commit 0698b56 into cilium:main Apr 30, 2024
12 of 13 checks passed
@mhofstetter mhofstetter deleted the pr/mhofstetter/ciliumlogs-without-filter-and-scanner branch April 30, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants