packer/command
Lucas Bajolet 548893bbee build: don't suggest lack of HCP support on fail
When running a build with HCP Packer enabled, Packer attempts to push
the build status to HCP.
If the build fails, we update the status to BUILD_FAILED, and that's the
end of it.
If however the build succeeds, Packer attempts to get the HCP artifact
from the builder, which will only succeed if the builder supports it.
Otherwise, we'll get either nil, or an artifact type that is not
compatible with what is expected for HCP support.

When either of those happens, we warn that the builder may not support
HCP Packer at all, so users are aware of the problem.

However, when the error was introduced, it only looked at the fact that
an error was produced, independently of the type of error. This caused
legitimate errors while building to be reported as potential
incompatibility between the builder and HCP, which was confusing to
users.

This commit changes this by introducing a new error type, only produced
when the artifact either is nil, or failed to be deserialised into a HCP
artifact, which lets us produce the incompatibility warning with more
accuracy.
2024-02-13 14:47:06 -05:00
..
enumflag [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
flag-kv [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
flag-slice [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
test-fixtures hcl2_upgrade: add required_plugins in out template 2023-07-18 16:04:55 -04:00
build.go build: don't suggest lack of HCP support on fail 2024-02-13 14:47:06 -05:00
build_cancellation_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
build_cleanup_script_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
build_parallel_test.go chore: unnecessary use of fmt.Sprintf 2023-09-21 09:38:23 -04:00
build_test.go chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
build_timeout_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
build_windows_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
cli.go command: add --force option to init/install 2023-12-04 16:34:31 -05:00
command_test.go chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
config_file_unix.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
config_file_windows.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
configtype_enumer.go Run make fmt to fix checks 2023-04-27 15:17:31 -04:00
console.go command: remove unused FlagSetFlags enum 2023-10-16 09:51:53 -04:00
console_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
exec_test.go Remove amazon plugin from acceptance test 2023-10-24 06:00:42 -04:00
fix.go command: remove unused FlagSetFlags enum 2023-10-16 09:51:53 -04:00
fix_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
fmt.go command: remove unused FlagSetFlags enum 2023-10-16 09:51:53 -04:00
fmt_test.go chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
hcl2_upgrade.go cmd/hcl2upgrade: Add VirtualBox as known plugin 2023-11-28 15:15:09 -05:00
hcl2_upgrade_test.go cmd/hcl2_upgrade: Don't error when using a HashiCorp plugin that is not installed 2023-10-24 06:00:42 -04:00
init.go docs: add exerpt on packer plugins install --path 2023-12-04 16:34:31 -05:00
init_test.go packer: remove single-component plugins 2024-01-12 09:06:22 -05:00
inspect.go command: remove unused FlagSetFlags enum 2023-10-16 09:51:53 -04:00
inspect_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
meta.go cmd/hcl2_upgrade: Don't error when using a HashiCorp plugin that is not installed 2023-10-24 06:00:42 -04:00
plugin.go Migrate HCP Packer to API V2 and new nomenclature changes (#12794) 2024-01-24 13:17:35 -05:00
plugins.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
plugins_install.go Update spacing for flags within Help text 2023-12-06 07:29:10 -05:00
plugins_install_test.go command: add packer plugins install path flag 2023-12-04 16:34:31 -05:00
plugins_installed.go packer: remove implicit required plugins 2023-08-17 16:51:49 -04:00
plugins_remove.go command: error on invalid plugins remove 2023-10-31 11:28:50 -04:00
plugins_remove_test.go command: error on invalid plugins remove 2023-10-31 11:28:50 -04:00
plugins_required.go command: remove unused FlagSetFlags enum 2023-10-16 09:51:53 -04:00
signal.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
test_utils.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
utils.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
utils_test.go chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
validate.go Remove functions for detecting plugin usage 2023-10-24 06:00:42 -04:00
validate_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
version.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
version_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00