Commit Graph
18131 Commits
Author SHA1 Message Date
hc-github-team-packer e2ed4b02ce Merge pull request #12305 from hashicorp/backport/dependabot/go_modules/github.com/hashicorp/hcp-sdk-go-0.36.0/barely-grateful-mongrel
This pull request was automerged via backport-assistant
2023-03-08 11:46:38 -05:00
Wilken Rivera 7e9735f026 Update golang.org/x/net to address GO-2023-1571
```
  » Go Modules Scanner
    ⚠︎ found OSV reported vulnerability GHSA-vvpx-j8f3-3w6h in golang.org/x/[email protected]
    ⚠︎ found OSV reported vulnerability GO-2023-1571 in golang.org/x/[email protected]
```
2023-03-01 16:48:47 -05:00
hc-github-team-packer 5cb7bb0c04 Merge pull request #12296 from hashicorp/backport/nywilken/nutanix-verified-badge/subtly-alive-hyena
This pull request was automerged via backport-assistant
2023-03-01 16:17:05 -05:00
hc-github-team-packer 9fc6993b92 Merge pull request #12293 from hashicorp/backport/nywilken/fix-json-build-display-bug/gradually-probable-buzzard
This pull request was automerged via backport-assistant
2023-03-01 15:20:06 -05:00
dependabot[bot] f476cbfea2 backport of commit 0e03749e5c 2023-03-01 20:01:55 +00:00
Wilken Rivera 3c489dfe28 backport of commit 7c8d992ce3 2023-02-28 18:58:59 +00:00
Wilken Rivera 793d31364e backport of commit 93885c4df6 2023-02-27 20:32:24 +00:00
hc-github-team-es-release-engineering 29ababdcc7 Bumped product version to 1.8.7. 2023-02-15 15:33:25 -06:00
Wilken Rivera 7c133022d2 Cut release 1.8.6 v1.8.6 2023-02-15 10:42:57 -05:00
Wilken Rivera 9f186e3d62 Update CHANGELOG 2023-02-15 10:38:46 -05:00
Wilken Rivera 877787931e build(deps): bump github.com/hashicorp/hcp-sdk-go from 0.29.0 to 0.34.0 (#12275) 2023-02-15 10:27:18 -05:00
Wilken Rivera a7e27853e5 Bump bundled plugins to latest available version (#12274) 2023-02-15 10:22:14 -05:00
Wilken Rivera 45fc0d4b6f Update github.com/hashicorp/go-getter/v2 pkgs to address CVE-2023-0475 2023-02-14 20:00:55 -05:00
Wilken Rivera 67c2f92d08 Update CHANGELOG 2023-02-09 20:00:14 -05:00
hc-github-team-packer e2ca082117 Merge pull request #12257 from hashicorp/backport/nywilken/hcl2upgrade-variables-empty-map/rationally-suited-walrus
This pull request was automerged via backport-assistant
2023-02-08 13:40:59 -05:00
Wilken Rivera f4522fa783 backport of commit 6c9e653120 2023-02-08 16:19:07 +00:00
hc-github-team-packer ae50a3b17e Merge pull request #12252 from hashicorp/backport/changelog-linux-bugfix/smoothly-intimate-lamb
This pull request was automerged via backport-assistant
2023-02-07 13:37:47 -05:00
Claire 62268bb25e backport of commit dfedfd3931 2023-02-06 21:32:39 +00:00
hc-github-team-packer 69039cc25d Merge pull request #12247 from hashicorp/backport/nywilken/release-branch-builds/largely-epic-weevil
This pull request was automerged via backport-assistant
2023-02-06 15:34:33 -05:00
hc-github-team-packer 12d8f796e8 Merge pull request #12246 from hashicorp/backport/nywilken/release-branch-builds/broadly-viable-skylark
This pull request was automerged via backport-assistant
2023-02-06 15:33:34 -05:00
Wilken Rivera 3375c6e9a5 Merge code changes from main into release branch 2023-02-06 14:50:29 -05:00
craigpero 65e5c9ed01 Update index.mdx
In trying the example, I found that you have to type "*.second-example" for the expected results.   I took the command line on line #78 literal and it didn't work as typed. When I used my proposed change... it worked for me.
Alternatively, "*.second*" works but that could grab builders that were not intended.
2023-02-06 14:45:24 -05:00
claire labry 1cd0150afd Introduce action-set-product-version for Packer (#12135)
This change introduces the new actions-set-product-version, a tiny, but mighty, GitHub action that acts as a bridge between the product repo and our new CRT feature: automated version bumping.

tl;dr automated version bumping has a new command (bob update version) in the bob CLI that automatically bumps the version to a new patch. This automation has been introduced to crt-workflows-common as a new workflow (with the new bob command) and handles version bumping at the end of the release pipeline (after being released to production); for example, 1.0.0→1.0.1 and 1.0.0-dev→1.0.0. Bumping the minor version (ie 1.0.x→1.1.0) is only supported manually via bob update version -bump minor, but not supported in CRT (this work is upcoming). This is made possible by adding the new event “bump-version” in the ci.hcl file in this PR.

What this small action does:

    Allows for the static version string from the version/VERSION file to be read by the new CRT workflow and automagically be bumped to the next version (whether it be a minor, or patch, or major version bump).
    Outputs an error if there’s no VERSION file in the version dir
    Outputs an error if there’s no version string in the VERSION file
    Is able to parse product_version if it is 1.3.0-alpha1 as 1.3.0 (example: when product_version = 1.3.0-alpha1, base_version = 1.3.0)
    Is able to parse prerelease product versions such as alpha1 (example prerelease_product_version = alpha1) in the statement above.
2023-02-06 14:44:43 -05:00
Gary McDonald 4b9e6b1c88 Fix the spelling of several words within the README.md stored in the website/ project directory. (#12197)
Signed-off-by: Gary McDonald <[email protected]>

Signed-off-by: Gary McDonald <[email protected]>
2023-02-06 14:43:30 -05:00
Ashlee Boyer 55a9d10995 Updating old learn link 2023-02-06 14:43:10 -05:00
Ashlee Boyer df8ff9483f Updating link to use cases docs page 2023-02-06 14:42:53 -05:00
Lucas Bajolet 79e989d03e hcl2: don't warn on excluded post-processor (#12187)
* hcl2template: use && for chaining conditions

For deciding if we need to run an error provisioner block, we checked
using a nested if that we didn't need to avoid running it.

This is unnecessary, and adds a superfluous level of inbrication to the
code, so we chain both conditions with &&.

* hcl2: don't warn on excluded post-processor

When a post-processor is excluded through the -except command-line
argument for packer build, we used to print a warning on HCL2 templates
if this except statement did not match a build.

However, since we can use the except option to avoid running
post-processors, we should account for this as well when printing out a
warning that there were no matches.

This commit adds this counter to the except checks for the
post-processors as well.
2023-02-06 14:41:45 -05:00
Lucas Bajolet b2a98664c9 hcp: remove superfluous return value on GetBuilds
This commit irons out one of the pain points of the HCP rework by
introducing a HCPPublisher interface, implemented both by the JSON Core,
and the HCL2 PackerConfig, which keeps a map of the build names used by
Packer to the build names pushed on HCP.

This in turn lets us go back to the old implementation of the GetBuilds
function, which returns a list of (filtered) builds, and eventually an
error if something went wrong while processing.
2023-02-06 14:40:07 -05:00
Lucas Bajolet afb59f6593 hcp: set the status to CANCELLED when a build is
Related to the previous behaviour problem, this changes how the status
of a build is set on HCP Packer, as a cancelled build is different from
a failed one, we can set it to the appropriate state on cancellation.
2023-02-06 14:38:00 -05:00
Lucas Bajolet b7317cc6c9 core: CoreBuild.Run error on cancelled builds
When a build is cancelled by a user, the current implementation of
CoreBuild.Run does not return an error signifying that there was a
problem with the build.

This in turn causes the HCP code to attempt to update the status of the
build to DONE, but fails because there are no artifacts to push.

This commit changes this behaviour by returning the error provoked by
the cancellation to the caller, so it can be taken into account when
setting the status of the build.
2023-02-06 14:34:43 -05:00
Wilken Rivera 7226fafdd6 Update CHANGELOG 2023-02-06 14:34:26 -05:00
Wilken Rivera 1b10a9fc40 Bump github.com/hashicorp/go-getter/v2 (#12161)
The latest version of Go-Getter contains a SMBClient timeout option,
along with an updated AWS SDK to improve S3 support.

```
go get github.com/hashicorp/go-getter/v2
go get github.com/hashicorp/go-getter/s3/v2
go get github.com/hashicorp/go-getter/gcs/v2
go mod tidy
```
2023-02-06 14:32:49 -05:00
Wilken Rivera 35dc9a81ed Update ReadFromHCLBuildBlock to use the hcp_packer_registry.Description
In packer v1.8.5, the bucket's description was not properly set in the
bucket object we use for HCP, therefore all the buckets created by
Packer did not have their description updated.

Before the change
```
--- FAIL: TestReadFromHCLBuildBlock (0.00s)
    --- FAIL: TestReadFromHCLBuildBlock/configure_bucket_using_only_hcp_packer_registry_block (0.00s)
        types.bucket_test.go:380: expected the build to to have contents of hcp_packer_registry block but it does not:   &registry.Bucket{
                Slug:         "hcp_packer_registry-block-test",
            -   Description:  "",
            +   Description:  "description from hcp_packer_registry block",
                Destination:  "",
                BucketLabels: {"org": "test"},
                ... // 5 identical fields
              }
FAIL
FAIL    github.com/hashicorp/packer/internal/hcp/registry       1.072s
FAIL
```

After Change
```
~>  go test ./...
?       github.com/hashicorp/packer/internal/hcp/api    [no test files]
ok      github.com/hashicorp/packer/internal/hcp/env    (cached)
ok      github.com/hashicorp/packer/internal/hcp/registry       1.130s

```
2023-02-06 14:32:06 -05:00
Wilken Rivera 76f7922288 Update BuildBlock with valid HCL2Ref (#12167)
While looking into #11932 I found that Packer will throw an error when
an unknown source is referenced from within the sources attribute for
a build block. The hcl.Diagnostics error includes a Subject, which
should highlight where in the HCL2 configuration file the unknown source resides.
But when creating the BuildBlock no HCL2Ref data is copied over, thus the
Subject is displayed with with zero value for an hcl.Range type.

This change updates the build creation logic to copy the HCL2Ref data
from the build block at decode time so that it can be properly
referenced downstream.

Closes #11932

Failure due to change in output
```
--- FAIL: TestValidateCommand_ShowLineNumForMissing (0.00s)
    --- FAIL: TestValidateCommand_ShowLineNumForMissing/test-fixtures/validate-invalid/missing_build_block.pkr.hcl (0.00s)
        validate_test.go:377: Unexpected output:   (
                """
                Error: Unknown source file.cho

            -     on  line 0:
            +     on test-fixtures/validate-invalid/missing_build_block.pkr.hcl line 6:
                  (source code not available)

                ... // 4 identical lines
                """
              )
        validate_test.go:379:
FAIL
FAIL    github.com/hashicorp/packer/command     1.002s
```
2023-02-06 14:31:33 -05:00
Wilken Rivera e6319f0ad0 Update Go checks to run on pull_requests (#12166)
Currently go-test and go-validate only run for users who have push
access to the Packer repo. We want to ensure tests and validation run
for all opened pull requests including public forks.
2023-02-06 14:30:46 -05:00
dependabot[bot] 0291e47698 build(deps): bump github.com/hashicorp/hcp-sdk-go from 0.28.0 to 0.29.0 (#12163)
Bumps [github.com/hashicorp/hcp-sdk-go](https://github.com/hashicorp/hcp-sdk-go) from 0.28.0 to 0.29.0.
- [Release notes](https://github.com/hashicorp/hcp-sdk-go/releases)
- [Changelog](https://github.com/hashicorp/hcp-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/hcp-sdk-go/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/hcp-sdk-go
  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>
2023-02-06 14:30:26 -05:00
Wilken Rivera 398f9c5c1a Reset to dev mode 2023-02-06 14:29:11 -05:00
Wilken Rivera f5a2d9696b Update CHANGELOG.md
Fix version for vSphere plugin
2023-02-06 14:28:53 -05:00
Wilken Rivera 55592c7b88 backport of commit 93400ed9dd 2023-02-06 19:22:45 +00:00
Wilken Rivera aa7f877466 backport of commit 93400ed9dd 2023-02-06 19:22:45 +00:00
hc-github-team-packer d240e52b73 Merge pull request #12222 from hashicorp/backport/variables-doc/namely-regular-cougar
This pull request was automerged via backport-assistant
2023-01-25 10:40:04 -05:00
lonegunmanb 6548d66d9e backport of commit 25444e0e87 2023-01-25 09:07:37 +00:00
hc-github-team-packer dc6c6f56f3 Merge pull request #12219 from hashicorp/backport/nywilken/update-outscale-documentation-version/verbally-relative-man
This pull request was automerged via backport-assistant
2023-01-24 18:39:44 -05:00
hc-github-team-packer 61ff5b3562 Merge pull request #12217 from hashicorp/backport/hcp-enable-oracle-plugin/smoothly-powerful-hornet
This pull request was automerged via backport-assistant
2023-01-24 15:52:49 -05:00
Wilken Rivera c8c2f9137f backport of commit 61b10faaa8 2023-01-24 16:18:48 +00:00
Wilken Rivera 08ef4b712e backport of commit 92a72c4a92 2023-01-24 15:44:45 +00:00
hc-github-team-packer 4bf60eddef Merge pull request #12212 from hashicorp/backport/fix-provisioner-doc/easily-closing-bug
This pull request was automerged via backport-assistant
2023-01-24 10:22:43 -05:00
lonegunmanb c855850831 backport of commit e86ec8e000 2023-01-24 14:43:46 +00:00
Wilken Rivera e4f31384a3 Cut release 1.8.5 v1.8.5 2022-12-12 16:40:41 -05:00
Wilken Rivera ad25ebc836 Update CHANGELOG 1.8.5 2022-12-12 16:34:32 -05:00