Merge pull request #14662 from falser101/release-3.5

[3.5] fix: close maintenance conn
This commit is contained in:
Benjamin Wang 2022-10-31 17:49:19 +08:00 committed by GitHub
commit 8902fe9246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,6 +92,7 @@ func NewMaintenance(c *Client) Maintenance {
err = c.getToken(dctx)
cancel()
if err != nil {
conn.Close()
return nil, nil, fmt.Errorf("failed to getToken from endpoint %s with maintenance client: %v", endpoint, err)
}
cancel = func() { conn.Close() }