mirror of
https://github.com/containers/podman.git
synced 2025-06-22 01:48:54 +08:00
Avoid empty SSH keys on applehv
[NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
@ -251,6 +251,14 @@ func (m *MacMachine) Init(opts machine.InitOptions) (bool, error) {
|
||||
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{
|
||||
Name: opts.Username,
|
||||
Key: key,
|
||||
@ -262,14 +270,6 @@ func (m *MacMachine) Init(opts machine.InitOptions) (bool, error) {
|
||||
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 {
|
||||
return false, builder.BuildWithIgnitionFile(opts.IgnitionPath)
|
||||
}
|
||||
|
Reference in New Issue
Block a user