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
pkg/endpoint: Simplify search for C header file during restore #11028
pkg/endpoint: Simplify search for C header file during restore #11028
Conversation
@pchaigno I could never get to the bottom of it but it is as it sounds in the comment. The first "read" would return |
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.
testing
I think we're talking about two different things. I was wondering if there was a special reason for listing the content instead of checking if the file exists. The second listing of the directory was introduced later. Checking directly if the file exists should hopefully remove the need for that second listing. |
9dd06eb
to
5760bb3
Compare
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.
LGTM, assuming @aanm's comment is addressed
Since we know the C header filename, we don't need to list the endpoint directory's content. We can simply check if the file exists. This commit retains the previous retry behavior: the endpoint header file was sometimes not found before the second directory listing. However, this commit introduces additional logging ('BUG' warning + badLogMessages entry) to fail our E2E tests if the buggy behavior arises. Signed-off-by: Paul Chaignon <paul@cilium.io>
5760bb3
to
e58d8d8
Compare
test-me-please |
Since we know the C header filename, we don't need to list the endpoint directory's content. We can simply check if the file exists.
Extracted from the host firewall branch.
@aanm Do you remember if there was a reason for listing the directory content instead of checking if the file exists? I feel like I'm missing something here. Commit
2365922
introduced this code.