Fix init teardown on bad ignition path

Fixes a bug where if a machine failed during init due to a bad ignition path, it would not be properly torn down.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
Jake Correnti
2024-01-04 20:35:45 -05:00
parent b01a330d37
commit 3bfdd79150
4 changed files with 19 additions and 15 deletions

View File

@ -259,7 +259,8 @@ func (m *MacMachine) Init(opts machine.InitOptions) (bool, error) {
})
if len(opts.IgnitionPath) > 0 {
return false, builder.BuildWithIgnitionFile(opts.IgnitionPath)
err = builder.BuildWithIgnitionFile(opts.IgnitionPath)
return false, err
}
if err := builder.GenerateIgnitionConfig(); err != nil {