-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[HPR-1138] Limit recursive plugin scanning to Packer plugin paths set by PACKER_CONFIG_DIR or PACKER_PLUGIN_PATH #12414
Conversation
a0a5075
to
fd9c658
Compare
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.
LGTM, I'm not super familiar with this part of the code, but it looks legit to me!
|
||
pluginPaths, err = c.discoverSingle(filepath.Join(path, "*", "*", "*", fmt.Sprintf("packer-plugin-*%s", binInstallOpts.FilenameSuffix()))) |
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.
I presume this was the reason for the high number of syscalls? Globbing with this pattern will try to unravel a ton of subpaths before eventually finding the plugin(s) itself?
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.
That would check out with the history of the problem, since this change was introduced with v1.8.0 presumably
I see there's a TODO list on the description of the PR, is it planned to check all three before merging it, or is it for follow-up issues? |
Yeah, I plan to address these todos within this PR. I need to validate functionality and ensure docs reflect the correct plugin loading order. Thanks for the initial reivew. |
bd28933
to
b746f50
Compare
759ec69
to
ba36cf4
Compare
Packer will try to discover installed plugins in all of the directories defined by packer.KnowPluginFolders. In a previous release logic was added to scan nested directories in order to load plugins installed by `packer plugins install`. This change resulted in a nested directory scan for each folder within the KnownPluginFolders slice. This change reduces the nested directory scan to only the directories where plugins would have been installed using `packer plugins install`
* PACKER_PLUGIN_PATH takes precedence over all
ba36cf4
to
172fab6
Compare
Merging to make available in the latest nightly. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Packer will try to discover installed plugins in all of the directories
defined by packer.KnowPluginFolders. In a previous release logic was
added to scan nested directories in order to load plugins installed by
packer plugins install
. This change resulted in a nested directoryscan for each folder within the KnownPluginFolders slice.
This change reduces the nested directory scan to only the directories
where plugins would have been installed using
packer plugins install
Closes: #12405
Closes: #12352
This is sort of a breaking change as it changes how plugins are loaded but also not really as I think it works like this now but might be incorrectly documented 😄
TODO
Update documentation to reflect how plugins are scanned and loaded. The current docs are a little out of date.Opening in a separate PR.