Commit Graph
18286 Commits
Author SHA1 Message Date
Lucas Bajolet 35f7cab47c command: remove unused FlagSetFlags enum
The enumeration for FlagSetFlags, which presumably was added when the
Meta structure was introduced, aims to pre-populate the flagset for a
subcommand with a series of arguments.

However, despite it being documented, it is actually not used, and
therefore can safely be removed from the codebase.
2023-10-06 10:51:32 -04:00
Tor Arne Vestbø a1722abf07 website: Add community maintained IPSW data source Packer plugin 2023-10-05 14:19:52 -04:00
Lucas Bajolet 434a1637f8 hcl2template: fix func to get vars from a config
The previous implementation of the GetVarsByType function worked only on
top-level attributes, ignoring the nested blocks in the structure.

This implies that if a datasource depends on another through an
expression within a nested block, we may not execute it first, and then
executing this datasource before its dependent is possible, resulting in
an error in the end.

This commit is an attempt at making this more reliable for HCL configs,
but only works on configs lifted from HCL files for now. We need to make
this more reliable for later iterations.
2023-10-05 10:31:04 -04:00
Lucas Bajolet 51ec78622d hcl2template: simplify startDatasource function 2023-10-05 10:31:04 -04:00
Lucas Bajolet d9259d6d12 hcl2template: extract attr filter code from ds
Datasources use their attribute's expressions to determine whether or
not they depend on another datasource, in order to get the list of
dependencies and execute them before executing a datasource.

This code may be useful later on for figuring out the dependencies for
any block, so we move this code to the utils.go file, and use this for
datasources.
2023-10-05 10:31:04 -04:00
Lucas Bajolet 14b6ad10fe hcl2template: report localtion for cycle detection
When a datasource fails to be evaluated because a cycle has been
detected, we point out one of the links of the chain now so that users
have a better idea of what to look at.
2023-10-05 10:31:04 -04:00
Lucas Bajolet 2a6ccaccab hcl2template: simplify datasource evaluation
Since datasources are recursively evaluated depending on their
dependencies, we don't need to pre-execute those that depend on nothing,
as the recursive traversal of the datasources will take care of that for
us.
2023-10-05 10:31:04 -04:00
Lucas Bajolet 8438d81d4d hcl2template: remove unused shouldContinue bool
Not sure why this was defined and returned, but the value was set, but
never used, as such this is not useful to keep in the code, so let's
simplify this now.
2023-10-05 10:31:04 -04:00
Wilken Rivera 8dcc6b9fd9 Bump Go tooling version to 1.20.8 2023-10-03 10:32:42 -04:00
Wilken Rivera 8490333f55 Fix broken acctest for Amazon data source
This change updates the Ubuntu image being from 16.04 to something more recent.
2023-10-02 06:50:04 -04:00
Lucas Bajolet c0e594738b init: warn if no requirements specified
When users call `packer init' on a template that does not specify a
`required_plugin' block, the command succeeds but does nothing, which is
not helpful for users that may expect their plugins to install.

To remedy that problem, we now output a message like what `packer
plugins required' does on templates without such a block, so that users
have an idea of what to change in order to get the command to work.
2023-09-27 14:47:00 -04:00
Shengjing Zhu d56db70a57 Bump github.com/pierrec/lz4 to v4.1.18 2023-09-26 12:16:40 -04:00
guoguangwu 7eb6a45cd4 chore: remove refs to deprecated io/ioutil
Signed-off-by: guoguangwu <[email protected]>
2023-09-26 11:13:31 -04:00
guoguangwu 324e628b86 chore: unnecessary use of fmt.Sprintf
Signed-off-by: guoguangwu <[email protected]>
2023-09-21 09:38:23 -04:00
Wilken Rivera 7f7567f686 Remove plugins on the integration framework
The active plugins that resided in a HashiCorp repository have been migrated to
the integrations framework and no longer need to be listed within the plugins-manifest file.
2023-09-15 12:04:29 -04:00
Sk.Lv 6fa0d25c51 website: register ksyun docuement 2023-09-15 09:13:31 -04:00
Lucas Bajolet 318529f373 hcl2template: remove value validation for locals
Local variables can't have a validation block in their definition, so
this step in not useful and should be removed.

Besides, since the validation was done on the local variables before
evaluation, it did nothing at all, as the PackerConfig.LocalVariables
collection gets populated during evaluation, so this is essentially a
no-op, and can be safely removed.
2023-09-06 12:07:37 -04:00
Wilken Rivera 48e8c3e680 Update version output for -v and --version flags
The flags -v and --version are handled by the CLI runner, which
outputs the raw version string. This change shortcuts the handling of
the flags to force Packer to run the version subcommand.

Closes: #12565
2023-08-28 14:59:34 -04:00
Ilya Voronin 2325c7e9c7 Set ivoronin/packer-plugin-sshkey version to 'latest' 2023-08-25 10:55:11 -04:00
cjlapao fa663b47bf Updating Community Tools webpage
Adding Parallels Packer Example
2023-08-25 07:44:49 -04:00
Wilken Rivera ebdee64c64 Bump backport assistant to latest version 2023-08-18 15:54:20 -04:00
Lucas Bajolet 3c6e3f52ce CHANGELOG: preparing for 1.9.5 2023-08-18 15:38:13 -04:00
Jamie Finnigan a0cb19927c .go-version: bump version of Go to 1.20.7 2023-08-18 13:46:32 -04:00
Lucas Bajolet 42da69e2bd CHANGELOG: cut 1.9.4 release 2023-08-18 10:58:42 -04:00
Wilken Rivera f8ebf69c0d telemetry: Add nil check in SetBundledUsage
Invoking Packer with the  CHECKPOINT_DISABLE env. variable the telemetry reporter is left uninitialized in order to disable telemetry reporting.
Any method calls on the nil reporter is expected to check if the reporter is active or in NOOP mode. This change fixes a crash when calling SetBundledUsage()
on a nil CheckpointTelemetry type that occurs when using a bundled plugin with CHECKPOINT_DISABLE=1.
2023-08-18 10:19:31 -04:00
Lucas Bajolet eb9e1a4795 packer: remove implicit required plugins
Since this feature is no longer something we plan to activate later, as
it contradicts with our efforts to remove bundled plugins, and
encouraging users to move to either manually installing plugins, or
managing them through `packer init', we clean-up the code for this
feature.
2023-08-17 16:51:49 -04:00
Wilken Rivera f961715161 Prepare for 1.9.4 dev mode 2023-08-17 13:10:23 -04:00
Wilken Rivera 999d751793 Rename duplicate ami name to fix failing test 2023-08-17 11:12:56 -04:00
Wilken Rivera 50e8f507ca Update CHANGELOG for 1.9.3 2023-08-17 11:05:55 -04:00
hashicorp-copywrite[bot] a961adfb70 Update BUSL LICENSE to include licensed product and version. (#12575)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-16 12:44:09 -04:00
Lucas Bajolet 2b32903fe3 Document PLSP-related environment variables
Since we added support for PLSPs recently, and it will be released as part of 1.9.3, we add some documentation regarding the environment variables we added, and a note regarding their relation to PLSP support.
2023-08-16 11:44:32 -04:00
Wilken Rivera c575946e4d Update terminology to reflect community editions of Packer (#12571) 2023-08-11 15:20:50 -04:00
Wilken Rivera 320fd8d6fb Update licensing for product release pipeline (#12570) 2023-08-11 15:19:13 -04:00
hashicorp-copywrite[bot] 19055df3ec [COMPLIANCE] License changes (#12568)
* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at https://hashi.co/license-faq, and details of the license at www.hashicorp.com/bsl.

* Update copyright file headers to BUSL-1.1

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-10 15:53:29 -07:00
Lucas Bajolet 4d0a51c189 go.mod: bump golang.org/x/net to v0.13.0
The version of the golang.org/x/net we used (v0.8.0), is vulnerable to a
rendering issue, potentially escaping text that should not be, which can
enable other attacks then.

Packer itself is not vulnerable to the CVE as we don't render web pages,
but security checks do point it as an issue, so we fix it by updating
the dependencies.

CVE refrerence: GO-2023-1988
2023-08-08 09:54:06 -04:00
Wilken Rivera 9ccec0d4d5 Removed repetitive statement from HCP debug logs (#12552)
* Remove repetitive log statement

The log being removed is duplicated each time evalContext is
called, which seems like an unneeded debug log.
2023-08-07 20:54:19 -04:00
Lucas Bajolet 168e464ee4 docker: add full image to docker README 2023-08-04 13:30:41 -04:00
Lucas Bajolet 376f0e9991 docker: remove trailing spaces for Docker README 2023-08-04 13:30:41 -04:00
Lucas Bajolet 55854f5537 Makefile: only build dev version of binary/docker
The Docker images release-light and release-full are not to be built
locally from a dev build, but from a release, and the commands to build
those images are only referenced in CI, so we don't need to ship them as
part of the makefile.
In addition, those images are not straightforward to build from the
Makefile, as they require quite a few things from the environment, as
well as the binary installed in a specific location, which is never
setup by the rest of the Makefile.

Therefore, we opted to simplify the Makefile so that it only builds
docker-dev for local use.
2023-08-04 13:30:41 -04:00
Lucas Bajolet c6da777715 workflows: add docker-full to build workflow 2023-08-04 13:30:41 -04:00
Lucas Bajolet 838736982c Dockerfile: add release-full target
In addition to the `release-light' target, we add a `release_full'
target to the Dockerfile, so that we can ship an image of Packer with
the official plugins pre-bundled in their latest version.
2023-08-04 13:30:41 -04:00
Lucas Bajolet ffe2776770 README: fix link to CONTRIBUTING
Since the main branch is not called master anymore, and the anchor was
renamed, we fix both these changes in the link to that page from the
README.
2023-08-04 13:30:41 -04:00
Lucas Bajolet b29abbcd8c Dockerfile: remove trailing whitespaces 2023-08-04 13:30:41 -04:00
Wilken Rivera 99c79ecbd6 Add build tags to skip amd64 tests on darwin/arm64 (#12549) 2023-08-02 15:34:06 -04:00
Wilken Rivera 848039dcdb Update plugin discover testing
* Add test case for loading plugin in CWD
* Add test case to validate checksume files are ignored
* Update Discover to include CWD "." in PluginFolders if KnowPluginFolders is unset
2023-08-01 16:20:58 -04:00
Wilken Rivera a96584fb56 Update plugin discover logic
When copying a plugin's checksum file (packer-plugin-*_SHA256SUM) installed by `packer plugins install` or `packer init`
into a separate directory the file may be copied with the executable bit turned out. If unchanged after the copy, Packer would
discover the checksum file as a possible plugin match and error when trying to execute describe on the plugin look a like. This change
adds a checksum file test to the plugin matching logic. If the discovered plugin name is a checksum it is excluded from the discovered plugin list.
2023-08-01 16:20:58 -04:00
Wilken Rivera d3d33714e6 Update plugin loading for current directory
Starting with Go 1.19 the loading of binaries from the current working directory was
deemed as a possible security problem. Thus the use of exec.Command or exec.LookPath no longer resolves
an executable within the current working directory. This change updates the discover logic to return absolute
paths for any discovered plugin, which is called directly when passed to exec.Command or exec.LookPath. By doing
this Packer is able to load a custom plugin sitting in the current working directory as it did in version prior to v1.9.2.
2023-08-01 16:20:58 -04:00
Wilken Rivera d1aa103ebc workflows/jira: Fix syntax error for createComment 2023-07-27 17:12:17 -04:00
hashicorp-tsccr[bot] 5c9ab19d8f Result of tsccr-helper -log-level=info -pin-all-workflows . 2023-07-27 09:05:01 -04:00
Lucas Bajolet 392232933f website: add usage notice to init
The `packer init' command's wording was not clear, so it was changed in
a preceding commit, and this commit aims to add more details on how the
command is meant to be used, along with a simple example.
2023-07-25 16:45:32 -04:00