From e1b0e3ce920ffa5c2547b13de3ed61908301497f Mon Sep 17 00:00:00 2001 From: Pam Selle <204372+pselle@users.noreply.github.com> Date: Mon, 25 Jan 2021 18:19:17 -0500 Subject: [PATCH] Remove -module option for taint and untaint This has been an error with help text, and can be removed. --- command/taint.go | 9 +-------- command/untaint.go | 13 +------------ website/docs/cli/commands/untaint.html.md | 6 ------ 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/command/taint.go b/command/taint.go index c53326eb9..6bdf4037c 100644 --- a/command/taint.go +++ b/command/taint.go @@ -21,14 +21,12 @@ type TaintCommand struct { func (c *TaintCommand) Run(args []string) int { args = c.Meta.process(args) - var module string var allowMissing bool cmdFlags := c.Meta.ignoreRemoteVersionFlagSet("taint") - cmdFlags.BoolVar(&allowMissing, "allow-missing", false, "module") + cmdFlags.BoolVar(&allowMissing, "allow-missing", false, "allow missing") cmdFlags.StringVar(&c.Meta.backupPath, "backup", "", "path") cmdFlags.BoolVar(&c.Meta.stateLock, "lock", true, "lock state") cmdFlags.DurationVar(&c.Meta.stateLockTimeout, "lock-timeout", 0, "lock timeout") - cmdFlags.StringVar(&module, "module", "", "module") cmdFlags.StringVar(&c.Meta.statePath, "state", "", "path") cmdFlags.StringVar(&c.Meta.stateOutPath, "state-out", "", "path") cmdFlags.Usage = func() { c.Ui.Error(c.Help()) } @@ -47,11 +45,6 @@ func (c *TaintCommand) Run(args []string) int { return 1 } - if module != "" { - c.Ui.Error("The -module option is no longer used. Instead, include the module path in the main resource address, like \"module.foo.module.bar.null_resource.baz\".") - return 1 - } - addr, addrDiags := addrs.ParseAbsResourceInstanceStr(args[0]) diags = diags.Append(addrDiags) if addrDiags.HasErrors() { diff --git a/command/untaint.go b/command/untaint.go index d11c88648..f593075e7 100644 --- a/command/untaint.go +++ b/command/untaint.go @@ -19,14 +19,12 @@ type UntaintCommand struct { func (c *UntaintCommand) Run(args []string) int { args = c.Meta.process(args) - var module string var allowMissing bool cmdFlags := c.Meta.ignoreRemoteVersionFlagSet("untaint") - cmdFlags.BoolVar(&allowMissing, "allow-missing", false, "module") + cmdFlags.BoolVar(&allowMissing, "allow-missing", false, "allow missing") cmdFlags.StringVar(&c.Meta.backupPath, "backup", "", "path") cmdFlags.BoolVar(&c.Meta.stateLock, "lock", true, "lock state") cmdFlags.DurationVar(&c.Meta.stateLockTimeout, "lock-timeout", 0, "lock timeout") - cmdFlags.StringVar(&module, "module", "", "module") cmdFlags.StringVar(&c.Meta.statePath, "state", "", "path") cmdFlags.StringVar(&c.Meta.stateOutPath, "state-out", "", "path") cmdFlags.Usage = func() { c.Ui.Error(c.Help()) } @@ -45,11 +43,6 @@ func (c *UntaintCommand) Run(args []string) int { return 1 } - if module != "" { - c.Ui.Error("The -module option is no longer used. Instead, include the module path in the main resource address, like \"module.foo.module.bar.null_resource.baz\".") - return 1 - } - addr, addrDiags := addrs.ParseAbsResourceInstanceStr(args[0]) diags = diags.Append(addrDiags) if addrDiags.HasErrors() { @@ -210,10 +203,6 @@ Options: -lock-timeout=0s Duration to retry a state lock. - -module=path The module path where the resource lives. By default - this will be root. Child modules can be specified by - names. Ex. "consul" or "consul.vpc" (nested modules). - -state=path Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate". diff --git a/website/docs/cli/commands/untaint.html.md b/website/docs/cli/commands/untaint.html.md index 85aab17d8..69b414982 100644 --- a/website/docs/cli/commands/untaint.html.md +++ b/website/docs/cli/commands/untaint.html.md @@ -43,12 +43,6 @@ certain cases, see above note). The list of available flags are: * `-lock-timeout=0s` - Duration to retry a state lock. -* `-module=path` - The module path where the resource to untaint exists. - By default this is the root path. Other modules can be specified by - a period-separated list. Example: "foo" would reference the module - "foo" but "foo.bar" would reference the "bar" module in the "foo" - module. - * `-no-color` - Disables output with coloring * `-state=path` - Path to read and write the state file to. Defaults to "terraform.tfstate".