mirror of https://github.com/containers/podman.git
Merge pull request #20683 from baude/applehvsshkeys
Avoid empty SSH keys on applehv
This commit is contained in:
commit
1d49773bb8
|
@ -251,6 +251,14 @@ func (m *MacMachine) Init(opts machine.InitOptions) (bool, error) {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(opts.IgnitionPath) < 1 {
|
||||||
|
key, err = machine.CreateSSHKeys(m.IdentityPath)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
callbackFuncs.Add(m.removeSSHKeys)
|
||||||
|
}
|
||||||
|
|
||||||
builder := machine.NewIgnitionBuilder(machine.DynamicIgnition{
|
builder := machine.NewIgnitionBuilder(machine.DynamicIgnition{
|
||||||
Name: opts.Username,
|
Name: opts.Username,
|
||||||
Key: key,
|
Key: key,
|
||||||
|
@ -262,14 +270,6 @@ func (m *MacMachine) Init(opts machine.InitOptions) (bool, error) {
|
||||||
Rootful: m.Rootful,
|
Rootful: m.Rootful,
|
||||||
})
|
})
|
||||||
|
|
||||||
if len(opts.IgnitionPath) < 1 {
|
|
||||||
key, err = machine.CreateSSHKeys(m.IdentityPath)
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
callbackFuncs.Add(m.removeSSHKeys)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(opts.IgnitionPath) > 0 {
|
if len(opts.IgnitionPath) > 0 {
|
||||||
return false, builder.BuildWithIgnitionFile(opts.IgnitionPath)
|
return false, builder.BuildWithIgnitionFile(opts.IgnitionPath)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue