Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

hcl2: report error on build without sources #12016

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

lbajolet-hashicorp
Copy link
Contributor

When a template describes a build block without a source reference, the build should be considered invalid as we won't have a CoreBuild produced as a result of the need to have both.

In current versions of Packer, this will produce an error message hinting that nothing will happen because of the lack of either build or source block.

This commit takes the defined block, and points out to it as missing a source block as being the reason why nothing is happening, making it clearer what is required for an HCL2 build to be processed.

@lbajolet-hashicorp lbajolet-hashicorp requested a review from a team as a code owner September 23, 2022 21:02
When a template describes a build block without a source reference, the
build should be considered invalid as we won't have a CoreBuild produced
as a result of the need to have both.

In current versions of Packer, this will produce an error message
hinting that nothing will happen because of the lack of either build or
source block.

This commit takes the defined block, and points out to it as missing a
source block as being the reason why nothing is happening, making it
clearer what is required for an HCL2 build to be processed.
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done. :shipit:

@lbajolet-hashicorp lbajolet-hashicorp merged commit c0e7e7b into main Sep 30, 2022
@lbajolet-hashicorp lbajolet-hashicorp deleted the error_build_no_source branch September 30, 2022 19:39
@nywilken nywilken added this to the 1.8.4 milestone Oct 26, 2022
@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants