Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close etcd leaky connection if client is not initialized
Currently, the `NewClient` method creates an Etcd client that is initialized and a go-routine is spawned off because it uses GPRC in the background. For the most part, CAPI handles closing this connection up in the stack. However, if the `newEtcdClient` method fails, we will then return a `nil` client, the go-routine that was spawned off will leak and CAPI will not be able to end it. This commit fixes that by forcing the `newEtcdClient` method to close connections if the client initialization fails.
- Loading branch information