-
Notifications
You must be signed in to change notification settings - Fork 454
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
Fix bug that threw an error while searching for linux headers through a symlink #1821
Conversation
We should update the error message when
|
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.
Can we try a PR description along the lines of:
Method fs::Exists
returned false for a broken symlink, but its expected behavior was to return true, i.e. because something existed (even if that something was a broken symlink). This function later fixes the broken symlink by reading its target and converting that target into a host path.
Removing the fs::Exists
check solves the bug where the function early exits before resolving a symlink (see above explanation) and is safe because the next check, is_symlink
will return an error code if there is no file.
Also, we can update the test plan, something like: deployed pem with bug fix and observed correct behavior. |
My own comment: The condition, removed in this PR, was fully redundant to the next check |
Signed-off-by: Kartik Pattaswamy <[email protected]>
Signed-off-by: Kartik Pattaswamy <[email protected]>
9678b99
to
5b911f6
Compare
Summary: This PR removes a condition which checks to see if a host path exists in the filesystem of a process when trying to resolve symlinks.
The function
fs::Exists()
returned false for a broken symlink when the expectation was to return true because the path existed although it was a broken symlink. This function would later on fix the broken symlink path by reading its target host and converting the broken path into the actual path. This makes the code removal safe as the next check:is_symlink
will return an error code if there is no file.Type of change: /kind bug
Test Plan: Existing tests pass and deployed the PEM with the updated fix and saw that the Linux header files were found.