1
0
mirror of https://github.com/hashicorp/packer.git synced 2026-02-05 21:45:13 +01:00
Files
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
..
2023-08-10 15:53:29 -07:00