Commit Graph
18303 Commits
Author SHA1 Message Date
Lucas Bajolet f3e4c2c3bb tmp: move HCP logic to unwrap builds/post 2022-11-14 13:31:35 -05:00
Lucas Bajolet f0d0a0e6c5 internal/registry: reverse image check condition
In order to determine whether or not a build is done or needs
processing, we check 3 things:

1. that its status is not done
2. that its ID is not empty
3. that it has no images linked to it

The was the image check was phrased indicated that we checked for the
reverse, so we reverse the naming to make it less confusing.
2022-11-14 13:31:35 -05:00
Wilken Rivera c1cd718e0e Update github.com/stretchr/testify to address vulnerabilities in dependencies
* Resolves CVE-2022-28948 in gopkg.in/yaml.v3

Many thanks to chncaption for bubbling this vulnerability in #12908
2022-11-11 10:36:07 -05:00
Lucas Bajolet 9d9f6d3a9a packer: try previous ver. on unavailable checksum
When Packer tries to get the latest version of a plugin, it will attempt
to get the latest version from a list that is picked from the list of
releases, fetched directly from Github.

What may happen is that a release is triggered, the assets are not yet
available, including the checksum file, which is uploaded last, at the
end of the release process.

This causes any client that tries to get the latest version of a plugin
to fail during that window, as the code will fail immediately whenever a
checksum file is unavailable.

To circumvent this issue, and fallback to a previous version, we
acknowledge that a checksum was unavailable then trying to get the
latest version, and fallback to a previous one.
2022-11-11 06:50:38 -05:00
Lucas Bajolet 0224d6e0de plugin_test: error on missing checksum file
The mockPluginGetter would always succeed in returning a file from the
list of suggested releases, which does not let us test what happens when
a release is not yet complete, and a checksum file fails to be fetched
from the source.

This commit changes this behaviour so that we get an error when a
checksum does not exist, mirrorring what happens in real conditions.
2022-11-11 06:50:38 -05:00
dependabot[bot] 113bc5eea4 Bump github.com/hashicorp/hcl/v2 from 2.13.0 to 2.14.1 (#12015)
Bumps [github.com/hashicorp/hcl/v2](https://github.com/hashicorp/hcl) from 2.13.0 to 2.14.1.
- [Release notes](https://github.com/hashicorp/hcl/releases)
- [Changelog](https://github.com/hashicorp/hcl/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/hcl/compare/v2.13.0...v2.14.1)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/hcl/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-02 13:07:31 -04:00
Zachary Shilton f3a0dbc491 chore: add empty page redirects 2022-11-01 17:15:02 -04:00
Zachary Shilton 1ec6b70028 chore: stub in empty page redirects 2022-11-01 17:15:02 -04:00
Paulo Dias 8ce3aae2f7 Add packages for iso builds 2022-10-28 13:12:17 -04:00
Wilken Rivera c6f530d6d5 Update CHANGELOG.md 2022-10-28 12:49:21 -04:00
Lucas Bajolet 83ca7c203c prepare 1.8.5 2022-10-28 12:13:31 -04:00
Lucas Bajolet 83cc093d50 cut release 1.8.4 v1.8.4 2022-10-28 10:43:05 -04:00
Wilken Rivera ef1fb675f7 Update CHANGELOG for 1.8.4 (#12083)
* Update CHANGELOG for 1.8.4

* Update HCP Packer environment variable notes

* Add CHANGELOG entry for 12068
2022-10-28 10:33:53 -04:00
Wilken Rivera 10c7b999ea Update bundled plugins to latest available version (#12085) 2022-10-27 18:24:13 -04:00
Lucas Bajolet 68ddb2f89d hcl2_upgrade: add share_image_gallery workaround (#12087)
In azure templates, the shared_image_gallery was mistakenly considered
an attribute while this is supposed to be a block.

This is due to a heuristic we use for deciding whether a JSON object is
to be translated to an attribute or a block that fell short as the
shared_image_gallery does not contain complex types.

This cannot be fixed trivially for the general case, so we add this
entity to the list of workarounds until we can implement something more
robust.
2022-10-27 18:09:40 -04:00
Jenna Goldstrich 0bac9b6f63 Remove a skip for darwin arm64 (m1/m2 macs) for exec tests. (#12088) 2022-10-27 17:52:26 -04:00
Lucas Bajolet 296562614f hcl2_upgrade: fix liniting issues with fmt.Sprintf
Some literal strings without format-string directives nor arguments were
littered around the hcl2_upgrade command's code, which is pointed out by
the linters.

Since they serve no purpose, we remove them.
2022-10-26 15:35:02 -04:00
Lucas Bajolet 3c249c0d42 hcl2_upgrade: replace passthroughs by pre-visit
In previous versions of hcl2_upgrade, we referenced a list of
passthrough statements from the original JSON template to be replaced by
their equivalent Go-template in HCL2.

This works but requires us to explicitely accept every possible
templated variable in order to not ever encounter <no value> in our
generated HCL2 templates.

This is suboptimal, hence this commit changes approach by pre-visting
the AST from the original Go Template, escaping every sequence that is
not covered by the list of functions we can migrate. Pipes are also
excluded from this function.
2022-10-26 15:35:02 -04:00
Wilken RiveraandLucas Bajolet bc55d6d2d6 [HPR-763] Update HCL variable documentation (#12058)
* Update HCL variable documentation

* Add supported arguments section for variables
* Add inpage links to key variable arguments
* Reorder content to cluster assignment documentation together
* Split variable definitions into two sub-sections

Co-authored-by: Lucas Bajolet <[email protected]>
2022-10-24 20:58:32 -04:00
Zach Shilton 7f533a0a63 website: fix intro link (#12076) 2022-10-24 15:24:42 -04:00
Zach Shilton 82062f05e9 website: reset redirects file (#12066)
* website: reset redirects file

* docs: add note on product prefix, with example

* docs: fix example redirect
2022-10-24 14:48:02 -04:00
HashiBot ed859dccb3 chore: Update Digital Team Files (#12069)
* Update generated scripts (website-start.sh)

* Update generated website Makefile

* Update generated scripts (website-build.sh)

* Update generated scripts (should-build.sh)
2022-10-24 14:46:25 -04:00
Wilken Rivera 1296cbfc92 Update links to packer-template-configuration (#12072) 2022-10-24 12:59:32 -04:00
Wilken RiveraandLaura Pacilio 414b576def [HPR-574] Add documentation for configuring Packer for HCP Packer (#12022)
* Add documentation for configuring Packer for HCP Packer

This change works to document the two configuration options for setting
up Packer to publish build artifacts to an active HCP Packer registry.
Currently the HashiCorp Cloud Platform documents the process for
configuring Packer via a HCL template, which is the preferred route.
This documentation focuses more on the use of environment variables for
configuring Packer for HCP Packer, which is necessary for legacy JSON
template users looking to publish to HCP Packer.

In light of the new HCP Packer documentation page we've opted for a shorter
version of the HCP Packer introduction section.

* Applying the first round of suggestions to tighten up the documentation.
* Move HCP Packer side bar to top
* Move intro into docs
* Add redirects for intro pages

Co-authored-by: Laura Pacilio <[email protected]>
2022-10-24 12:51:14 -04:00
Wilken Rivera 7cb0c98925 Merge pull request #12033 from hashicorp/error_messages_rework
[HPR-575] command/build: rework HCP-related error messages
2022-10-21 11:25:15 -04:00
Zach ShiltonandWilken Rivera 879fd9035c fix: update redirected and broken links (#12060)
* website: fix broken links on /docs/templates

* fix: redirected install-plugins link

* fix: debugging link

* fix: secrets manager link in docs

* fix: secrets manager link in source

* fix: amazon ami plugin link in docs

* fix: amazon ami plugin link in source

* fix: extending plugins link

* fix: plugins/builders/amazon links

* fix: various builders links

* fix: various amazon builder links

* fix: redirected terminology link

* fix: custom-provisioners link

* fix: docker-push redirected plugin link

* fix: googlecompute plugin links

* fix: hyperv iso plugin links

* website: update link to hcl upgrade guide

Co-authored-by: Wilken Rivera <[email protected]>

Co-authored-by: Wilken Rivera <[email protected]>
2022-10-21 11:00:58 -04:00
Lucas Bajolet 61c810e720 command: rework HCP-related error messages
The HCP error messages were sometimes a bit terse in terms of the
information it bubbles up to the user.
This made them useful for people who already knew what to look for, but
newcomers would almost certainly be lost because of the lack of
information in those.

To improve on this situation, we reword most of those error messages in
this commit.
2022-10-21 10:32:45 -04:00
Wilken Rivera 78c2aac4bb Merge pull request #12057 from hashicorp/mktg-tf-6712e33a71cea60092a300cbfcf59096
chore: Update Digital Team Files
2022-10-21 10:29:40 -04:00
Wilken Rivera 81eb1caca5 Merge pull request #12061 from hashicorp/json_template_engine_doc_fix
docs: move legacy JSON warning under title
2022-10-21 09:55:56 -04:00
Lucas Bajolet 84dc228a68 docs: move legacy JSON warning under title
With the move to Hashidocs, the version picker is within the text area
for the documentation being displayed. This negatively interacts with
the Note on top, as it obstructs part of the text.

To circumvent this problem, we move the Note after the title/intro.
2022-10-21 09:20:34 -04:00
Lucas Bajolet 35496e533d packer: include builder type in HCP name for JSON
JSON templates used only to report the builder's type in HCP builds,
even if the name was specified.

This commit changes this behaviour to include both if they're available,
in a similar fashion as what is done on the HCL2 templates.
2022-10-20 17:12:33 -04:00
HashiBot ce0831dcfd Update generated scripts (website-build.sh) 2022-10-19 08:53:17 -05:00
HashiBot 478258943a Update generated scripts (website-start.sh) 2022-10-19 08:53:16 -05:00
HashiBot 0c0e1f587c Update generated website Makefile 2022-10-19 08:53:14 -05:00
HashiBot cb5c0a5bc7 Update generated scripts (should-build.sh) 2022-10-19 08:53:12 -05:00
Wilken Rivera 971340d481 Merge pull request #12051 from hashicorp/mktg-tf-21f31f4b058995a77ae6b19a62636241
chore: Update Digital Team Files
2022-10-18 13:25:05 -05:00
HashiBot 31829b40d7 Update generated scripts (should-build.sh) 2022-10-14 17:31:03 -05:00
HashiBot 27f6de3a61 Update generated scripts (website-start.sh) 2022-10-14 17:31:02 -05:00
HashiBot b748490513 Update generated scripts (website-build.sh) 2022-10-14 17:31:00 -05:00
HashiBot c373acc43c Update generated website Makefile 2022-10-14 17:30:59 -05:00
Wilken Rivera 0eb25b5775 Update CHANGELOG 2022-10-14 11:44:42 -04:00
Laura Pacilio 72d9c07374 Remove sidebar entries that no longer exist 2022-10-14 08:37:11 -04:00
Lucas Bajolet c2dc140896 hcp: read fingerprint from env during initialize
Previously, we'd get the fingerprint for an iteration when creating the
bucket.
Since we moved the remainder of the logic for getting the iteration to a
separate Initialize method, we also move the logic that reads the
fingerprint from the environment to this function.
2022-10-13 15:13:29 -04:00
Wilken Rivera 6693128d73 Read loading over bucket name from env var 2022-10-13 15:13:29 -04:00
Wilken Rivera 12e9316f94 Add documenation for HCPConfigMode type 2022-10-13 15:13:29 -04:00
Wilken Rivera 148d5e3a2d Add initialize method to Iteration
Fingerprint initialize was previously occurring during the creation of a
bucket. We want to be able to initialize a bucket and defer the setting
of a fingerprint to a later point.

* Update test to reflect new function signatures for Bucket and Iteration
2022-10-13 15:13:29 -04:00
Wilken Rivera 7f7f397124 Rename withHCLBucketConfiguration function 2022-10-13 15:13:29 -04:00
Wilken Rivera a4a97d5c05 Move datasource data into its own bucketConfiguratioOpts func 2022-10-13 15:13:29 -04:00
Wilken Rivera cf9304266e Consolidate bucket configuration logic 2022-10-13 15:13:29 -04:00
Wilken Rivera 0efd064d29 Update IsHCPExplicitelyEnabled logic 2022-10-13 15:13:29 -04:00