-
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
Associate Packer build to HCP Packer parent iteration #11832
Conversation
* Fix typo for HCP_PACKER_BUILD_FINGERPRINT env in test * Add test Fingerprint where needed; failing tests were not showing because they are properly set for acctest
c75d489
to
a49efc5
Compare
@@ -48,7 +48,8 @@ func (p *Parser) decodeHCPRegistry(block *hcl.Block, cfg *PackerConfig) (*HCPPac | |||
BuildLabels map[string]string `hcl:"build_labels,optional"` | |||
Config hcl.Body `hcl:",remain"` | |||
} | |||
diags := gohcl.DecodeBody(body, cfg.EvalContext(LocalContext, nil), &b) | |||
ectx := cfg.EvalContext(DatasourceContext, nil) |
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 it makes more sense if this is BuildContext
considering that the hcp_packer_registry
is inside the build block. What do you think?
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.
Good point. I'll update.
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 solution looks pretty simple and straightforward. Well done! 👍🏼
I will download the binary and run a quick test! I will let you know when I'm done.
I tested it by creating child iterations based on one and two parents. All worked as expected, so 👍🏼 !! |
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. |
This change allows Packer core to validate that a newly build image is a child of a HCP Packer registry source image. This association is handle by checking the source of a build against the reported source image of a build artifact that is configured to publish to the HCP Packer registry.