Remove removed upgrade commands
Delete commands that are no longer in Terraform and have been removed for a full release cycle.
This commit is contained in:
parent
1ae3d30383
commit
08b649b6f9
|
@ -1,32 +0,0 @@
|
|||
package command
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
type ZeroTwelveUpgradeCommand struct {
|
||||
Meta
|
||||
}
|
||||
|
||||
func (c *ZeroTwelveUpgradeCommand) Run(args []string) int {
|
||||
c.Ui.Output(`
|
||||
The 0.12upgrade command has been removed. You must run this command with
|
||||
Terraform v0.12 to upgrade your configuration syntax before upgrading to the
|
||||
current version.`)
|
||||
return 0
|
||||
}
|
||||
|
||||
func (c *ZeroTwelveUpgradeCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform 0.12upgrade
|
||||
|
||||
The 0.12upgrade command has been removed. You must run this command with
|
||||
Terraform v0.12 to upgrade your configuration syntax before upgrading to
|
||||
the current version.
|
||||
`
|
||||
return strings.TrimSpace(helpText)
|
||||
}
|
||||
|
||||
func (c *ZeroTwelveUpgradeCommand) Synopsis() string {
|
||||
return "Rewrites pre-0.12 module source code for v0.12"
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package command
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/mitchellh/cli"
|
||||
)
|
||||
|
||||
func TestZeroTwelveUpgrade_deprecated(t *testing.T) {
|
||||
ui := new(cli.MockUi)
|
||||
c := &ZeroTwelveUpgradeCommand{
|
||||
Meta: Meta{
|
||||
Ui: ui,
|
||||
},
|
||||
}
|
||||
|
||||
if code := c.Run([]string{}); code != 0 {
|
||||
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
||||
}
|
||||
|
||||
output := ui.OutputWriter.String()
|
||||
if !strings.Contains(output, "The 0.12upgrade command has been removed.") {
|
||||
t.Fatal("unexpected output:", output)
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package command
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ZeroThirteenUpgradeCommand upgrades configuration files for a module
|
||||
// to include explicit provider source settings
|
||||
type ZeroThirteenUpgradeCommand struct {
|
||||
Meta
|
||||
}
|
||||
|
||||
func (c *ZeroThirteenUpgradeCommand) Run(args []string) int {
|
||||
c.Ui.Output(`
|
||||
The 0.13upgrade command has been removed. You must run this command with
|
||||
Terraform v0.13 to upgrade your provider requirements before upgrading to the
|
||||
current version.`)
|
||||
return 0
|
||||
}
|
||||
|
||||
func (c *ZeroThirteenUpgradeCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform 0.13upgrade
|
||||
|
||||
The 0.13upgrade command has been removed. You must run this command with
|
||||
Terraform v0.13 to upgrade your provider requirements before upgrading to
|
||||
the current version.
|
||||
`
|
||||
return strings.TrimSpace(helpText)
|
||||
}
|
||||
|
||||
func (c *ZeroThirteenUpgradeCommand) Synopsis() string {
|
||||
return "Rewrites pre-0.13 module source code for v0.13"
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package command
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/mitchellh/cli"
|
||||
)
|
||||
|
||||
func TestZeroThirteenUpgrade(t *testing.T) {
|
||||
ui := new(cli.MockUi)
|
||||
c := &ZeroThirteenUpgradeCommand{
|
||||
Meta: Meta{
|
||||
Ui: ui,
|
||||
},
|
||||
}
|
||||
|
||||
if code := c.Run([]string{}); code != 0 {
|
||||
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
||||
}
|
||||
|
||||
output := ui.OutputWriter.String()
|
||||
if !strings.Contains(output, "The 0.13upgrade command has been removed.") {
|
||||
t.Fatal("unexpected output:", output)
|
||||
}
|
||||
}
|
14
commands.go
14
commands.go
|
@ -328,18 +328,6 @@ func initCommands(
|
|||
// Plumbing
|
||||
//-----------------------------------------------------------
|
||||
|
||||
"0.12upgrade": func() (cli.Command, error) {
|
||||
return &command.ZeroTwelveUpgradeCommand{
|
||||
Meta: meta,
|
||||
}, nil
|
||||
},
|
||||
|
||||
"0.13upgrade": func() (cli.Command, error) {
|
||||
return &command.ZeroThirteenUpgradeCommand{
|
||||
Meta: meta,
|
||||
}, nil
|
||||
},
|
||||
|
||||
"force-unlock": func() (cli.Command, error) {
|
||||
return &command.UnlockCommand{
|
||||
Meta: meta,
|
||||
|
@ -408,8 +396,6 @@ func initCommands(
|
|||
}
|
||||
|
||||
HiddenCommands = map[string]struct{}{
|
||||
"0.12upgrade": struct{}{},
|
||||
"0.13upgrade": struct{}{},
|
||||
"env": struct{}{},
|
||||
"internal-plugin": struct{}{},
|
||||
"push": struct{}{},
|
||||
|
|
Loading…
Reference in New Issue