inspect command: ignore init errors as some value can be unset

This commit is contained in:
Adrien Delorme 2020-08-27 11:54:36 +02:00
parent eb4069a1b7
commit 652878059c
1 changed files with 4 additions and 5 deletions

View File

@ -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,
})