mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
Fixes #15154 Change order when config and connections are written
When the break out or the WSL environment fails to start, the config and connections should not be written. Placing them at the end of the provisioning step will mitigate the issue. [NO NEW TESTS NEEDED] Signed-off-by: Gerard Braad <me@gbraad.nl>
This commit is contained in:
@ -364,14 +364,6 @@ func (v *MachineVM) Init(opts machine.InitOptions) (bool, error) {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if err := v.writeConfig(); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if err := setupConnections(v, opts, sshDir); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
dist, err := provisionWSLDist(v)
|
||||
if err != nil {
|
||||
return false, err
|
||||
@ -393,6 +385,14 @@ func (v *MachineVM) Init(opts machine.InitOptions) (bool, error) {
|
||||
// Cycle so that user change goes into effect
|
||||
_ = terminateDist(dist)
|
||||
|
||||
if err := v.writeConfig(); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if err := setupConnections(v, opts, sshDir); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user