From 652878059cf3a4b27bae3b6e01ee256c2fc9e6dc Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 27 Aug 2020 11:54:36 +0200 Subject: [PATCH] inspect command: ignore init errors as some value can be unset --- command/inspect.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/command/inspect.go b/command/inspect.go index d304c7926..1542e19fc 100644 --- a/command/inspect.go +++ b/command/inspect.go @@ -44,11 +44,10 @@ func (c *InspectCommand) RunContext(ctx context.Context, cla *InspectArgs) int { if ret != 0 { return ret } - diags := packerStarter.Initialize() - ret = writeDiags(c.Ui, nil, diags) - if ret != 0 { - return ret - } + + // here we ignore init diags to allow unknown variables to be used + _ = packerStarter.Initialize() + return packerStarter.InspectConfig(packer.InspectConfigOptions{ Ui: c.Ui, })