Skip to content

Commit

Permalink
fix(host-deployer): check sshclient is nil on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
wanyaoqi committed Jan 26, 2024
1 parent a4a1794 commit f5e14d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/hostman/diskutils/qemu_kvm/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,10 @@ func (d *QemuKvmDriver) connect(guestDesc *apis.GuestDesc) error {
}

func (d *QemuKvmDriver) Disconnect() error {
d.sshClient.Close()
if d.sshClient != nil {
d.sshClient.Close()
}

d.qemuArchDriver.CleanGuest()
d.qemuArchDriver = nil
return nil
Expand Down

0 comments on commit f5e14d6

Please sign in to comment.