-
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: link to docs if a component is missing #12705
Conversation
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 think you could add some unit test coverage but otherwise looks good!
@@ -218,15 +219,33 @@ func (c *Core) BuildNames(only, except []string) []string { | |||
func (c *Core) generateCoreBuildProvisioner(rawP *template.Provisioner, rawName string) (CoreBuildProvisioner, error) { | |||
// Get the provisioner | |||
cbp := CoreBuildProvisioner{} | |||
|
|||
if !c.components.PluginConfig.Provisioners.Has(rawP.Type) { |
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.
Might be worth updating the core build tests in packer/core_test.go
for this change, but I didn't dig into these tests too much to see how practical that is
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.
This looks great! Nicely done on the quick turnaround.
I think the output needs a little formatting
~> packer validate ansible_docker.json
Error: Failed to initialize build "docker"
The builder docker is unknown by Packer, and is likely part of a plugin that is
not installed.
You may find the plugin needed in the Packer integrations, and install it as
documented there:
https://developer.hashicorp.com/packer/integrations?filter=docker
~> packer validate ansible_ssh_no_proxy_ssm.pkr.hcl
Error: Unknown source type amazon-ebs
on ansible_ssh_no_proxy_ssm.pkr.hcl line 29:
(source code not available)
The source amazon-ebs is unknown by Packer, and is likely part of a plugin that
is not installed.
You may find the plugin needed in the Packer integrations, and install it as
documented there:
https://developer.hashicorp.com/packer/integrations?filter=amazon
Error: Unknown provisioner type "ansible"
on ansible_ssh_no_proxy_ssm.pkr.hcl line 32:
(source code not available)
The provisioner ansible is unknown by Packer, and is likely part of a plugin
that is not installed.
You may find the plugin needed in the Packer integrations, and install it as
documented there:
https://developer.hashicorp.com/packer/integrations?filter=ansible
~> packer build qemu_fedora_compress_googlecompute-import_post-processor.pkr.hcl
Error: Unknown source type qemu
on qemu_fedora_compress_googlecompute-import_post-processor.pkr.hcl line 39:
(source code not available)
The source qemu is unknown by Packer, and is likely part of a plugin that is not
installed.
You may find the plugin needed in the Packer integrations, and install it as
documented there:
https://developer.hashicorp.com/packer/integrations?filter=qemu
Error: Unknown post-processor type "googlecompute-import"
on qemu_fedora_compress_googlecompute-import_post-processor.pkr.hcl line 46:
(source code not available)
The post-processor googlecompute-import is unknown by Packer, and is likely part
of a plugin that is not installed.
You may find the plugin needed in the Packer integrations, and install it as
documented there:
https://developer.hashicorp.com/packer/integrations?filter=googlecompute
When a user invokes packer for a build or validation, the template being processed needs components to be present for Packer to process it without error. If the component cannot be found from the plugins loaded (or from the components bundled with Packer), Packer errors, and the command fails. This is expected, but the error message does not suggest anything to fix the error, potantially leaving users confused at the problem. This commit suggests either a replacement (in case of a typo), or points to the web documentation for Packer, specifically the integrations, so they can look for the plugin they're missing, and install it, so subsequent invocations of Packer work.
1faa48f
to
19ca583
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 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 invokes packer for a build or validation, the template being processed needs components to be present for Packer to process it without error.
If the component cannot be found from the plugins loaded (or from the components bundled with Packer), Packer errors, and the command fails.
This is expected, but the error message does not suggest anything to fix the error, potantially leaving users confused at the problem.
This commit suggests either a replacement (in case of a typo), or points to the web documentation for Packer, specifically the integrations, so they can look for the plugin they're missing, and install it, so subsequent invocations of Packer work.