Fix missing defer statement for im client closure
This results to a closure of the im client before triggering the version
call, which therefore guaranteed to always fail.
Longhorn 3922
@@ -82,7 +82,7 @@ func updateInstanceManagerVersion(im *longhorn.InstanceManager) error {
if err != nil {
return err
}
- cli.Close()
+ defer cli.Close()
apiMinVersion, apiVersion, err := cli.VersionGet()
if err != nil {
return err
