From 862dc36884c4e2906aa05b12b940a3630f8ace6b Mon Sep 17 00:00:00 2001 From: Kristin Laemmert Date: Tue, 12 May 2020 08:39:12 -0400 Subject: [PATCH] command/init: include config loader diagnostics in output (#24921) Previously the diagnostics from the config loaders (earlyconfig and regular) were only appended to the overall diags if an error was found. This adds all diagnostics from the regular config loader so that any generated warnings will be displayed, even if there are no errors. I did not add the `earlyconfig` warnings since they will be displayed if there is an error and are likely to be duplicated by the config loader. --- command/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/init.go b/command/init.go index f0fd59a2db..382d3b3745 100644 --- a/command/init.go +++ b/command/init.go @@ -213,9 +213,9 @@ func (c *InitCommand) Run(args []string) int { } _, confDiags = c.loadConfig(path) + diags = diags.Append(confDiags) if confDiags.HasErrors() { c.Ui.Error(strings.TrimSpace(errInitConfigError)) - diags = diags.Append(confDiags) c.showDiagnostics(diags) return 1 }