From a373750e5e719b3b2846a4b6f7e0829099f02090 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Tue, 12 Mar 2024 11:27:25 -0400 Subject: [PATCH 1/2] Add ignore-prerelease-flag to command help text --- command/build.go | 1 + command/cli.go | 4 ++-- command/validate.go | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/command/build.go b/command/build.go index b48d248d50c..330e05e643b 100644 --- a/command/build.go +++ b/command/build.go @@ -437,6 +437,7 @@ Options: -var 'key=value' Variable for templates, can be used multiple times. -var-file=path JSON or HCL2 file containing user variables, can be used multiple times. -warn-on-undeclared-var Display warnings for user variable files containing undeclared variables. + -ignore-prerelease-plugins Disable the loading of prerelease plugin binaries (x.y.z-dev). ` return strings.TrimSpace(helpText) diff --git a/command/cli.go b/command/cli.go index 2fa3c02fdea..0cd82c2749a 100644 --- a/command/cli.go +++ b/command/cli.go @@ -91,7 +91,7 @@ func (ba *BuildArgs) AddFlagSets(flags *flag.FlagSet) { flags.BoolVar(&ba.MetaArgs.WarnOnUndeclaredVar, "warn-on-undeclared-var", false, "Show warnings for variable files containing undeclared variables.") - flags.BoolVar(&ba.ReleaseOnly, "ignore-prerelease-plugins", false, "Disable the loading of prerelease plugin binaries (x.y.z-.") + flags.BoolVar(&ba.ReleaseOnly, "ignore-prerelease-plugins", false, "Disable the loading of prerelease plugin binaries (x.y.z-dev).") ba.MetaArgs.AddFlagSets(flags) } @@ -146,7 +146,7 @@ func (va *ValidateArgs) AddFlagSets(flags *flag.FlagSet) { flags.BoolVar(&va.SyntaxOnly, "syntax-only", false, "check syntax only") flags.BoolVar(&va.NoWarnUndeclaredVar, "no-warn-undeclared-var", false, "Ignore warnings for variable files containing undeclared variables.") flags.BoolVar(&va.EvaluateDatasources, "evaluate-datasources", false, "evaluate datasources for validation (HCL2 only, may incur costs)") - flags.BoolVar(&va.ReleaseOnly, "ignore-prerelease-plugins", false, "Disable the loading of prerelease plugin binaries (x.y.z-.") + flags.BoolVar(&va.ReleaseOnly, "ignore-prerelease-plugins", false, "Disable the loading of prerelease plugin binaries (x.y.z-dev).") va.MetaArgs.AddFlagSets(flags) } diff --git a/command/validate.go b/command/validate.go index da41e30cf0a..47d88a901ba 100644 --- a/command/validate.go +++ b/command/validate.go @@ -123,6 +123,7 @@ Options: -var-file=path JSON or HCL2 file containing user variables, can be used multiple times. -no-warn-undeclared-var Disable warnings for user variable files containing undeclared variables. -evaluate-datasources Evaluate data sources during validation (HCL2 only, may incur costs); Defaults to false. + -ignore-prerelease-plugins Disable the loading of prerelease plugin binaries (x.y.z-dev). ` return strings.TrimSpace(helpText) From 2b19ee8eb9c22d6815cae052e12bd7ebcc4d7a07 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Tue, 12 Mar 2024 11:29:45 -0400 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73991381f0a..01ce10f58eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,11 @@ └── packer-plugin-happycloud_v0.0.1_x5.0_darwin_arm64_SHA256SUM ``` +### FEATURES: +* core: Add `-ignore-prerelease-plugins` flag to disable the use of development + plugin binaries for the `build` and `validate` commands development plugin + binaries. [GH-12828](https://github.com/hashicorp/packer/pull/12828) + ### IMPROVEMENTS: * core: Move to predictable plugin loading schema - Packer will now only load plugins stored under PACKER_PLUGIN_PATH using the expected namespaced