Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HPR-1420] Remove bundled plugins from Packer core #12660

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

nywilken
Copy link
Member

@nywilken nywilken commented Oct 19, 2023

This should go into a feature branch for 1.10.0 where we can iterate on the changes and the addition of the updated plugin loading logic.

Changes

  • Remove all HashiCorp vendored plugins
  • Remove amazon plugin from acceptance test
  • Remove functions for detecting plugin usage
  • cmd/hcl2_upgrade: Don't error when using a HashiCorp plugin that is not installed

The plugin github.com/hashicorp/packer-plugin-amazon was removed as a plugin but the module is still within the go.mod file because it is used as a package within the hcl2_upgrade command.

@nywilken nywilken changed the title nywilken/remove all bundled plugins Remove bundled plugins from Packer core Oct 19, 2023
@nywilken nywilken changed the title Remove bundled plugins from Packer core [HPR-1420] Remove bundled plugins from Packer core Oct 19, 2023
@nywilken nywilken marked this pull request as ready for review October 19, 2023 19:09
@nywilken nywilken requested a review from a team as a code owner October 19, 2023 19:09
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple comments, but overall the code looks good to me!
I'll let you address those and I can come back later for a second pass.

command/meta.go Outdated Show resolved Hide resolved
command/hcl2_upgrade_test.go Show resolved Hide resolved
acctest/plugin/component_acc_test.go Show resolved Hide resolved
command/hcl2_upgrade.go Outdated Show resolved Hide resolved
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code removal's always neat.
Just left one final comment, aside from that, LGTM!

@@ -1,18 +1,19 @@
packer {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be me, but looks like this one is not used, is it?

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.
…ot 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
@nywilken nywilken force-pushed the nywilken/remove-all-bundled-plugins branch from 33f20a7 to e57a394 Compare October 24, 2023 09:53
@nywilken nywilken merged commit da06116 into main Oct 24, 2023
11 checks passed
@nywilken nywilken deleted the nywilken/remove-all-bundled-plugins branch October 24, 2023 10:01
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants