From ef86b2c6738b5c5ee73cd685070d76e23d9ec7ff Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 7 May 2019 18:33:53 -0700 Subject: [PATCH] command/0.12checklist: Additional commentary in output Along with the checklist items, we should also include some surrounding commentary to add context about what these recommendations are for. If no changes seem to be required at all, we direct the user back to the upgrade guide in case there are other steps described there that this tool is unable to detect or represent. --- command/012checklist.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/command/012checklist.go b/command/012checklist.go index 9a514e537d..d5b7b354d0 100644 --- a/command/012checklist.go +++ b/command/012checklist.go @@ -70,10 +70,17 @@ func (c *ZeroTwelveChecklistCommand) Run(args []string) int { items := make(map[string][]string) hasItems := c.zeroTwelveChecklists(root, items) if !hasItems { - // TODO: Success message + fmt.Print( + "Looks good! We did not detect any problems that ought to be\naddressed before upgrading to Terraform v0.12.\n\n" + + "This tool is not perfect though, so please check the v0.12 upgrade\nguide for additional guidance, and for next steps:\n https://www.terraform.io/upgrade-guides/0-12.html\n\n", + ) return 0 } + fmt.Print( + "After analyzing this configuration and working directory, we have identified some necessary steps that we recommend you take before upgrading to Terraform v0.12:\n\n", + ) + modKeys := make([]string, 0, len(items)) for k := range items { modKeys = append(modKeys, k) @@ -104,6 +111,10 @@ func (c *ZeroTwelveChecklistCommand) Run(args []string) int { } } + fmt.Print( + "Taking these steps before upgrading to Terraform v0.12 will simplify the upgrade process by avoiding syntax errors and other compatibility problems.\n\n", + ) + return 1 }