Remove -module option for taint and untaint

This has been an error with help text, and can be removed.
This commit is contained in:
Pam Selle 2021-01-25 18:19:17 -05:00
parent f6951a5d8e
commit e1b0e3ce92
3 changed files with 2 additions and 26 deletions

View File

@ -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() {

View File

@ -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".

View File

@ -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".