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

Create separate LayerFilesystem from RootFilesystem #575

Merged
merged 8 commits into from
Apr 3, 2024

Conversation

Schamper
Copy link
Member

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 88.39286% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 74.90%. Comparing base (24d3b3d) to head (02d281d).

Files Patch % Lines
dissect/target/filesystem.py 95.00% 5 Missing ⚠️
...issect/target/plugins/os/unix/linux/fortios/_os.py 0.00% 3 Missing ⚠️
dissect/target/loaders/vb.py 0.00% 2 Missing ⚠️
dissect/target/plugins/os/unix/esxi/_os.py 0.00% 2 Missing ⚠️
...ct/target/plugins/os/unix/linux/debian/vyos/_os.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #575      +/-   ##
==========================================
+ Coverage   74.84%   74.90%   +0.06%     
==========================================
  Files         288      288              
  Lines       24048    24103      +55     
==========================================
+ Hits        17998    18055      +57     
+ Misses       6050     6048       -2     
Flag Coverage Δ
unittests 74.90% <88.39%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

assert lfs.path("file1").read_text() == "value1"
lfs.remove_fs_layer(vfs4)
lfs.prepend_fs_layer(vfs4)
assert lfs.path("file1").read_text() == "value4"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you not want the most recently added layer to be dominant over any previously added layer?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe. I've currently kept it this way because that's how it behaved before. I'll throw it up for opinion within the team.

Copy link
Member Author

Choose a reason for hiding this comment

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

After a short but powerful vote we've indeed decided that it's best to reverse this now. We'll need to perform some testing to make sure everything works as expected for ESXi and FortiOS (two heavy users of the layers). Do you still have some FortiOS test images that you could perhaps test these changes against?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to be working OK on FortiGate VMs. The syntax stays the same, right? FortiOS plugin currently uses:

target.fs.add_layer().mount("/foo", TarFilesystem(...))

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, syntax is the same, just the resolution order is changed. I didn't expect anything to break, but always good to verify!

@Schamper Schamper requested a review from Horofic March 27, 2024 20:55
@Schamper Schamper merged commit a314d25 into main Apr 3, 2024
16 checks passed
@Schamper Schamper deleted the separate-root-layer-fs branch April 3, 2024 14:01
Zawadidone pushed a commit to Zawadidone/dissect.target that referenced this pull request Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants