-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(maint) Do not recurse into recursive globbed exclusions when purging
When we purge at the environment level we create recurse globs of our Puppetfile managed directories, eg "<environment>/modules/**/*". Previous to this patch we would collect a list of all content in the environment and then match them against this recursive glob using `File.fnmatch?`. This means we could be doing fnmatches against hundreds of thousands of then-filtered results which can become prohibitively slow. This patch removes the usage of Dir.glob to retrieve all files and instead manually recurses into child directories if set to recurse and the child does not match either the purge_exclusions or whitelist globs. However, because we match using a glob something like "<environment>/modules/**/*" won't match "<environment>/modules", but instead will filter each module within "<environment>/modules". In large deployments this may mean filtering over a thousand child files, but will prevent us from recursing into any of the modules themselves. This maintains the post-recursion filtering of "desired_contents" as this is how git-backed, environment maintained files are cleaned.
- Loading branch information
1 parent
709e040
commit 9070c6a
Showing
3 changed files
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters