-
Notifications
You must be signed in to change notification settings - Fork 50
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
Improve LayerFilesystem iterdir and scandir #973
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #973 +/- ##
==========================================
- Coverage 77.71% 77.69% -0.02%
==========================================
Files 326 326
Lines 28559 28569 +10
==========================================
+ Hits 22194 22198 +4
- Misses 6365 6371 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -1535,6 +1535,9 @@ def iterdir(self) -> Iterator[str]: | |||
yielded = {".", ".."} | |||
selfentry = self._resolve() | |||
for fsentry in selfentry.entries: | |||
if not fsentry.is_dir(): |
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 you add unit tests?
… in Overlay2Filesystem implementation
Upon further debugging we discovered the root cause for these The When a This is undesired behaviour to say the least, so we replaced |
@JSCU-CNI can you still add a unit test that showcases the originally faulty behavior so that I can try some other ways to fix this? |
This PR prevents
NotADirectoryError
DirectoryFilesystemEntry
exceptions from crashing plugins when iteratingLayerFilesystem
entries usingrecurse
,iterdir
orscandir
.