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

Extract and generalize the sniffer logic used by encryption tests for easier reusability #2248

Merged
merged 6 commits into from
Jan 22, 2024

Conversation

giorio94
Copy link
Member

@giorio94 giorio94 commented Jan 19, 2024

Please review commit by commit and refer to the individual commit messages for additional details. Most of the changes in this PR are due to moving code around, and are isolated in their own commits (second, third and sixth).

So that we can retrieve whether debug logging is enabled to guard
possible expensive operations to be performed only when debug logging
is enabled.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
As a preparatory step for the subsequent extraction of the sniffer logic
into a separate package, let's start extracting the safeBuffer utility.
The only difference is that the mutex is no longer embedded into, but an
explicit field of lock.Buffer, as per best practices.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Let's extract this logic into a separate package, so that it can be
easily reused by other connectivity tests in addition to the encryption
ones. At this stage, no additional changes are introduced except for
exporting the necessary types/methods and adapting the call sites.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Following the extraction of this logic into a separate package, let's also
generalize it a bit, to improve its reusability in different contexts.
While being there, let's also improve the error reporting, to simplify
troubleshooting possible issues.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Let's extract the definition of this filter into a separate package
alongside the sniffer logic, so that it can be easily reused as well.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Copy link
Contributor

@squeed squeed left a comment

Choose a reason for hiding this comment

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

nice!

@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 Jan 22, 2024
@squeed squeed merged commit 506977f into cilium:main Jan 22, 2024
13 checks passed
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.

None yet

4 participants