-
Notifications
You must be signed in to change notification settings - Fork 178
Description
The artifacts/system/{getcap,immutable}.yaml artifacts use dirwalk.sh in order to avoid non-local mount points. However, dirwalk.sh does not obey the normal filters used by "find" type artifacts such as exclude_path_pattern and exclude_name_pattern. This is a problem when dirwalk.sh dives into large directory structures that are local to the system where the collection is being run, which "find" collectors have been configured to avoid.
If you look at the way the "hash" collector is constructed, it uses the common code to build find commands (_build_find_command) and then tacks xargs <hashcmd> onto the end of it. Can't we generalize this pattern? Suppose we allowed "find" collectors to have a command: parameter, which could then be appended via xargs.
Suddenly, {getcap,immutable}.yaml are just "find" collectors that have a "command:" parameter. And, in fact, the need for a specialized "hash" collector goes away.
However, if we head off in this direction, the semantics of %non_local_mount_points% will have to change. It is currently a pipe separated list. It would need to change to a comma separated list so that it could be used as part of exclude_path_pattern. The good news is that %non_local_mount_points% is only used in {getcap,immutable}.yaml, which we would be refactoring anyway.