From 5ad6100ff3f0ab8ab687ff368cb46e54fe98b0b4 Mon Sep 17 00:00:00 2001 From: Pam Selle <204372+pselle@users.noreply.github.com> Date: Mon, 11 Jan 2021 11:47:23 -0500 Subject: [PATCH 1/2] Remove get-plugins Remove the no-op get-plugins flag --- command/init.go | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/command/init.go b/command/init.go index 656be36ef..32ef519ea 100644 --- a/command/init.go +++ b/command/init.go @@ -34,7 +34,7 @@ type InitCommand struct { func (c *InitCommand) Run(args []string) int { var flagFromModule string - var flagBackend, flagGet, flagUpgrade, getPlugins bool + var flagBackend, flagGet, flagUpgrade bool var flagPluginPath FlagStringSlice var flagVerifyPlugins bool flagConfigExtra := newRawFlags("-backend-config") @@ -45,7 +45,6 @@ func (c *InitCommand) Run(args []string) int { cmdFlags.Var(flagConfigExtra, "backend-config", "") cmdFlags.StringVar(&flagFromModule, "from-module", "", "copy the source of the given module into the directory before init") cmdFlags.BoolVar(&flagGet, "get", true, "") - cmdFlags.BoolVar(&getPlugins, "get-plugins", true, "no-op flag, use provider_installation blocks to customize provider installation") cmdFlags.BoolVar(&c.forceInitCopy, "force-copy", false, "suppress prompts about copying state data") cmdFlags.BoolVar(&c.Meta.stateLock, "lock", true, "lock state") cmdFlags.DurationVar(&c.Meta.stateLockTimeout, "lock-timeout", 0, "lock timeout") @@ -64,16 +63,6 @@ func (c *InitCommand) Run(args []string) int { c.pluginPath = flagPluginPath } - // If users are setting the no-op get-plugins command, give them a warning, - // this should allow us to remove the flag in the future. - if !getPlugins { - diags = diags.Append(tfdiags.Sourceless( - tfdiags.Warning, - "No-op -get-plugins flag used", - `As of Terraform 0.13+, the -get-plugins=false command is a no-op flag. If you would like to customize provider installation, use a provider_installation block or other available Terraform settings.`, - )) - } - // Validate the arg count args = cmdFlags.Args() if len(args) > 1 { @@ -980,11 +969,6 @@ Options: -get=true Download any modules for this configuration. - -get-plugins=true Download any missing plugins for this configuration. - This command is a no-op in Terraform 0.13+: use - -plugin-dir settings or provider_installation blocks - instead. - -input=true Ask for input if necessary. If false, will error if input was required. From e22ccd424c1fc783363333cc8f8fe1155875d3fd Mon Sep 17 00:00:00 2001 From: Pam Selle <204372+pselle@users.noreply.github.com> Date: Mon, 11 Jan 2021 14:55:49 -0500 Subject: [PATCH 2/2] Add note about removal to web docs --- website/docs/commands/init.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/docs/commands/init.html.markdown b/website/docs/commands/init.html.markdown index c46b5e989..3863f3ce2 100644 --- a/website/docs/commands/init.html.markdown +++ b/website/docs/commands/init.html.markdown @@ -147,7 +147,8 @@ You can modify `terraform init`'s plugin behavior with the following options: -> Note: Since Terraform 0.13, this option has been superseded by the [`provider_installation`](./cli-config.html#provider-installation) and [`plugin_cache_dir`](./cli-config.html#plugin_cache_dir) settings. - It should not be used in Terraform versions 0.13+. + It should not be used in Terraform versions 0.13+, and this option + was removed in Terraform 0.15. - `-plugin-dir=PATH` — Force plugin installation to read plugins _only_ from the specified directory, as if it had been configured as a `filesystem_mirror` in the CLI configuration. If you intend to routinely use a particular