Skip to content

Commit

Permalink
Merge pull request kubernetes-csi#167 from pohly/close-connection
Browse files Browse the repository at this point in the history
sanity: close old connection when creating a new one
  • Loading branch information
k8s-ci-robot authored Feb 14, 2019
2 parents 4409815 + 82961cb commit 08c270e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/sanity/sanity.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ func (sc *SanityContext) setup() {
// dynamically (and differently!) in a BeforeEach, so only
// reuse the connection if the address is still the same.
if sc.Conn == nil || sc.connAddress != sc.Config.Address {
if sc.Conn != nil {
sc.Conn.Close()
}
By("connecting to CSI driver")
sc.Conn, err = utils.Connect(sc.Config.Address)
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit 08c270e

Please sign in to comment.