diff options
author | Gerard Braad <me@gbraad.nl> | 2022-08-04 14:56:54 +0800 |
---|---|---|
committer | Gerard Braad <me@gbraad.nl> | 2022-08-05 11:14:58 +0800 |
commit | d4c6e056db67f58320252a381149983d28ce4454 (patch) | |
tree | 9e0b497554a7bd9430463f75e11321b2f89959ed /pkg | |
parent | b0ef621ebf196fd61189aebff3161927f0049c52 (diff) | |
download | podman-d4c6e056db67f58320252a381149983d28ce4454.tar.gz podman-d4c6e056db67f58320252a381149983d28ce4454.tar.bz2 podman-d4c6e056db67f58320252a381149983d28ce4454.zip |
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>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/machine/wsl/machine.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/machine/wsl/machine.go b/pkg/machine/wsl/machine.go index 9a57102f0..8f6ef7a43 100644 --- a/pkg/machine/wsl/machine.go +++ b/pkg/machine/wsl/machine.go @@ -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 } |