packer/hcl2template
Hari eee3805c06
Some checks are pending
build / get-go-version (push) Waiting to run
build / set-product-version (push) Waiting to run
build / generate-metadata-file (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} freebsd 386 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} netbsd 386 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} openbsd 386 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} solaris 386 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} windows 386 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} freebsd amd64 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} netbsd amd64 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} openbsd amd64 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} solaris amd64 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} windows amd64 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} freebsd arm build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} netbsd arm build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} openbsd arm build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} linux 386 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} linux amd64 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} linux arm build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} linux arm64 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} linux ppc64le build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} darwin amd64 build (push) Blocked by required conditions
build / Go ${{ needs.get-go-version.outputs.go-version }} darwin arm64 build (push) Blocked by required conditions
build / Docker light 386 build (push) Blocked by required conditions
build / Docker light amd64 build (push) Blocked by required conditions
build / Docker light arm build (push) Blocked by required conditions
build / Docker light arm64 build (push) Blocked by required conditions
build / Docker full 386 build (push) Blocked by required conditions
build / Docker full amd64 build (push) Blocked by required conditions
build / Docker full arm build (push) Blocked by required conditions
build / Docker full arm64 build (push) Blocked by required conditions
Go Test / get-go-version (push) Waiting to run
Go Test / Linux go tests (push) Blocked by required conditions
Go Test / Darwin go tests (push) Blocked by required conditions
Go Test / Windows go tests (push) Blocked by required conditions
Go Validate / get-go-version (push) Waiting to run
Go Validate / Go Mod Tidy (push) Blocked by required conditions
Go Validate / Lint (push) Blocked by required conditions
Go Validate / Fmt check (push) Blocked by required conditions
Go Validate / Generate check (push) Blocked by required conditions
Feature/enforced provisioner (#13591)
* added the parser for the enforced block

* Enhance enforced provisioner parsing to support HCL and JSON formats

- Updated ParseProvisionerBlocks to handle both HCL and JSON syntax, including legacy JSON format.

- Added comprehensive test cases for JSON provisioner parsing.

- Improved ExtractBuildProvisionerHCL to merge inline commands from shell provisioners.

- Enhanced logging for enforced block operations in HCP Packer.

* Remove PublishEnforcedBlocks function from Bucket struct

* Remove ExtractBuildProvisionerHCL function and unused imports

* Reverted the version upgrade

* Added the internal-sdk for the enforcedProvsioner api changes

* Enhance enforced provisioner handling and error reporting

- Update error handling in FetchEnforcedBlocks to return detailed errors instead of warnings.
- Modify GetCoreBuildProvisionerFromBlock to accept build name for overrides.
- Add tests for FetchEnforcedBlocks to ensure correct behavior and error handling.
- Implement diagnostics for unsupported legacy JSON templates.

* Implement enforced provisioner parsing and handling

- Introduced a new package `enforcedparser` to handle parsing of enforced provisioner blocks from HCL and JSON formats.

- Refactored existing code to utilize the new `ParseProvisionerBlocks` function from the `enforcedparser` package.

- Updated `GetCoreBuildProvisionerFromEnforcedBlock` method to convert enforced provisioner blocks into core build provisioners.

- Enhanced error handling and logging during the parsing process.

- Added tests for the new parsing functionality and ensured existing tests were updated to reflect changes.

- Modified `InjectEnforcedProvisioners` method in JSON registry to utilize the new parsing logic.

* Add test case for -skip-enforcement flag in BuildArgs

* Refactor sensitive variable handling in provisioners and add related tests

* Refactor enforced provisioner handling: remove internal parser, update tests, and streamline API interactions

* Enhance provisioner block parsing: add error handling for invalid combinations and expand test coverage

* Remove internal SDK replacement for enforced block types in go.mod

* Update dependencies in go.mod and go.sum: bump hcp-sdk-go and packer-plugin-sdk versions, adjust syft version, and update OpenTelemetry packages

* Update hcp-sdk-go dependency to v0.172.0 in go.mod and go.sum

* Fix formatting in TestBuildCommand_ParseArgs and add newline at end of json_enforced_test.go

* Refactor testJSONRegistryWithBuilds: remove environment variable setup and streamline registry initialization

* Rename injected variable for clarity in InjectEnforcedProvisioners function

---------

Co-authored-by: Hari Om <58305594+Madhav008@users.noreply.github.com>
2026-04-17 14:17:28 +05:30
..
addrs [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
fixtures hcl2: fix crash on malformed overrides (#11881) 2022-07-20 14:30:49 -04:00
function [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
internal [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
repl [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
shim [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
testdata formatting multiple hcl files (#13362) 2025-05-02 10:16:00 +05:30
common_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
components.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
decode.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
docs.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
enforced_provisioner.go Feature/enforced provisioner (#13591) 2026-04-17 14:17:28 +05:30
enforced_provisioner_parser.go Feature/enforced provisioner (#13591) 2026-04-17 14:17:28 +05:30
enforced_provisioner_test.go Feature/enforced provisioner (#13591) 2026-04-17 14:17:28 +05:30
formatter.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
formatter_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
functions.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
parser.go BUG: Scrub multiline sensitive values from build output 2026-03-26 12:04:48 +05:30
plugin.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.build.from.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.build.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.build.hcp_packer_registry.go Merge pull request #13540 from hashicorp/compliance/update-headers 2025-12-22 15:34:39 +05:30
types.build.hcp_packer_registry_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.build.post-processor.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.build.provisioners.go Feature/enforced provisioner (#13591) 2026-04-17 14:17:28 +05:30
types.build.provisioners_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.build_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.datasource.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.datasource_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.hcl_post-processor.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.hcl_provisioner.go Feature/enforced provisioner (#13591) 2026-04-17 14:17:28 +05:30
types.hcl_ref.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.packer_config.go Feature/enforced provisioner (#13591) 2026-04-17 14:17:28 +05:30
types.packer_config_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.refstring.go hcl2template: rename Name->LocalName for local 2024-10-29 16:10:29 -04:00
types.required_plugins.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.required_plugins_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.source.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.source_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.variables.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
types.variables_test.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
utils.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
version.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00
version_required.go [COMPLIANCE] Update Copyright and License Headers (Batch 2 of 5) 2025-12-11 07:02:15 +00:00