-
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
packer: error multiple paths in PACKER_PLUGIN_PATH #12967
packer: error multiple paths in PACKER_PLUGIN_PATH #12967
Conversation
packer/plugin_folders.go
Outdated
|
||
"github.com/hashicorp/packer-plugin-sdk/pathing" | ||
) | ||
|
||
// PluginFolder returns the known plugin folder based on system. | ||
func PluginFolder() (string, error) { | ||
if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" { | ||
if strings.Contains(packerPluginPath, ":") { |
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.
The operator on windows is ";" you can use os.PathListSeparator here to determine if there are multiple paths defined.
When a user defines PACKER_PLUGIN_PATH in their environment, we need to error if their path defines multiple directories separated by `:`. This used to be supported, but this is removed with 1.11 as we're simplifying the loading process for plugins, so we opted to fall-back to only one plugin directory supported.
d9b5c4d
to
f7b41b6
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.
Nice! LGTM
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.
We can add a test for this in the testing branch. For now.
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. |
When a user defines PACKER_PLUGIN_PATH in their environment, we need to error if their path defines multiple directories separated by
:
.This used to be supported, but this is removed with 1.11 as we're simplifying the loading process for plugins, so we opted to fall-back to only one plugin directory supported.