-
Couldn't load subscription status.
- Fork 727
Power user dir #467
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
Power user dir #467
Conversation
a545caf to
6b921c8
Compare
|
Update: Added support for Following issues are targeted
Test
|
Signed-off-by: Mikey Strauss <[email protected]> Signed-off-by: houdini91 <[email protected]>
Signed-off-by: houdini91 <[email protected]>
* Shared directory resolver filetree Signed-off-by: houdini91 <[email protected]>
6b921c8 to
6168a01
Compare
|
@houdini91 very nice addition! I see the performance reason for introducing the shared trees between What do you think about this as an alternative approach to the shared filetree? |
|
|
||
| uid := -1 | ||
| gid := -1 | ||
| if stat, ok := info.Sys().(*syscall.Stat_t); ok { |
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.
good catch 👍
|
@wagoodman I totally agree, sharing a directoryResolver is probably simpler than sharing a FileTree pointer. Can you please clarify a bit on the Mutex comment?
|
Signed-off-by: houdini91 <[email protected]>
280dc91 to
56f30dd
Compare
This wouldn't be ideal since any
You're right, I overlooked this --the mutex for the resolver technically should already be there today. Let's leave the mutex 👍 |
* Use pointer to source struct Signed-off-by: houdini91 <[email protected]>
a93b404 to
a82eab0
Compare
Updated code to reflect change.
|
|
@houdini91 this looks good, thanks for the updates! Only one last change to get past validations: https://github.com/anchore/syft/pull/467/checks?check_run_id=3508971289 a linter failure for a variable name. Once passing we'll merge this in. |
Signed-off-by: houdini91 <[email protected]>
7a7a52d to
d1f97c6
Compare
|
@wagoodman Fixed lint error, |
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.
Thanks for this! Approving per review by @wagoodman
* Power-user directory source support Signed-off-by: Mikey Strauss <[email protected]> Signed-off-by: houdini91 <[email protected]> * Remove newline Signed-off-by: houdini91 <[email protected]> * Shared filetree (#1) * Shared directory resolver filetree Signed-off-by: houdini91 <[email protected]> * PR - change error ErrObserve to ErrPath Signed-off-by: houdini91 <[email protected]> * PR - share directory resolver * Use pointer to source struct Signed-off-by: houdini91 <[email protected]> * Fix Lint Signed-off-by: houdini91 <[email protected]>
Hi guys.
My first contribution here, sorry if i am missing something.
Add support of using directory type sources on the power-user command.
Following support have been addressed
readpermissions, encountering a permission error fails the catalogers.Fix: Log the error (debug) instead of failing, skip ahead.
Reason:
directoryResolver.AllLocations,directoryResolver.FilesByGlobreturns locations that is not connected to the directory resolver file references.PR: Return locations that are connected to directory resolver file references.
Test
test/cli/power_user_cmd_test.go,default-dir-results-w-pkg-coverageusing thedir:test-fixtures/image-pkg-coveragesource.test/cli/power_user_cmd_test.go,defaut-secrets-dir-results-w-reveal-valuesusing thedir:test-fixtures/image-secretssource.(
TestDirectoryResolverDoesNotIgnoreRelativeSystemPaths,TestClassifierCataloger_DefaultClassifiers_PositiveCases)Open issue
Hope minor patch helps.
Ps love your work.