Commit graph

18303 commits

Author SHA1 Message Date
hc-github-team-es-release-engineering
98176f5429 Update LICENSE text 2023-11-08 13:05:25 -05:00
ygXXII
19c14fd1e2
docs: fix aws_secretsmanager Title Name (#12678)
Just a simple doc title fix.
2023-11-02 05:36:36 -04:00
Lucas Bajolet
f221a799d8 command: error on invalid plugins remove
If a user attempts to remove a plugin through the `packer plugins
remove' subcommand, and the specified plugin is not installed, the
command succeeds, but does nothing, and exits silently.

This is not clear what is happening, and arguably, calling a command
that does nothing, not even explain what went wrong, is not intuitive.

Because of that, this commit changes how the command behaves in this
case, stating what went wrong, and exiting with a non-zero status.
2023-10-31 11:28:50 -04:00
Lucas Bajolet
c528681dde docs: amend HCL templates/functions docs
The HCL2 docs on built-in functions contains a link to a non-existent
section of the expressions page, so we update it to link to the general
page, and to the string interpolation section, since it is a common use
case.
2023-10-30 09:36:03 -04:00
Wilken Rivera
0ec424aa25
Fix broken link to Consul's environment variables page (#12673) 2023-10-30 07:50:53 -04:00
Wilken Rivera
71aa2f3f96 Bump required Go version in CONTRIBUTING guide 2023-10-26 15:03:55 -04:00
Wilken Rivera
452e855dd9 Update README
* Add BUSL 1.1 license badge
* Update links to learn tutorials
* Removed dated getting started example
2023-10-26 15:03:55 -04:00
Lucas Bajolet
d47cbe7f48 command: remove SHA256SUM file on plugin removal
When a user invokes `packer plugins remove', the plugin binary gets
removed, but not the corresponding SHA256SUM file.

This patch changes this so that when a binary is removed, so is its
SHA256SUM file.
2023-10-26 12:49:36 -04:00
Lucas Bajolet
3c8de6e5ad plugins: install SHA256SUM file with 0644 perms
When invoking `packer plugins install' to install a plugin, or `packer
init', the checksum file would be installed with 0555 permissions.

This led in turn to further attempts at installing the plugin will
succeed, but the checksum file would not be updated, as it was marked
non-writable by the owner of the file, leading potentially to a
situation where the plugin binary and the checksum would be out-of-sync,
but could not be updated unless the user changed it.

To avoid such a problem, we write the checksum file with 0644
permissions, so the owner can read/write, while the other users can only
read it.
2023-10-26 10:35:33 -04:00
Wilken Rivera
da061169bc cmd/hcl2_upgrade: Don't error when using a HashiCorp plugin that is not installed
This change updates hcl2_upgrade to not flag known plugin components, those used for generating the required plugins
block, when upgrading a legacy JSON template to HCL2. Any unknown plugins will be installed after running packer init
on the generated template so we don't error. We may want to suggest running packer init to install any missing plugins.

* Move knownPluginPrefixes into the hcl2_upgrade command
2023-10-24 06:00:42 -04:00
Wilken Rivera
e8d5436228 Remove functions for detecting plugin usage
With the removal of vendored_plugins we are no longer interested in tacking bundled plugins usage.
For plugins such as file, null, or anything bultin into Packer we don't track because there is no
way to install them outside of Packer, for now.
2023-10-24 06:00:42 -04:00
Wilken Rivera
c65bb2fdca Remove amazon plugin from acceptance test 2023-10-24 06:00:42 -04:00
Wilken Rivera
ac71611cf5 Remove all HashiCorp vendored plugins 2023-10-24 06:00:42 -04:00
dependabot[bot]
fa5d0359eb build(deps-dev): bump @babel/traverse from 7.17.9 to 7.23.2 in /website
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.9 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 14:19:11 -04:00
Jamie Finnigan
9a1d4b5219 go get -u google.golang.org/grpc && go mod tidy 2023-10-23 08:20:24 -04:00
Jamie Finnigan
193f5e1f60 go get -u golang.org/x/net && go mod tidy 2023-10-23 08:20:24 -04:00
Jamie Finnigan
0e5776a9af build with Go 1.20.10 2023-10-23 08:20:24 -04:00
Lucas Bajolet
020f18e37f 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-16 09:51:53 -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 <guoguangwu@magic-shield.com>
2023-09-26 11:13:31 -04:00
guoguangwu
324e628b86 chore: unnecessary use of fmt.Sprintf
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
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