fix: Improve closure of provisioner and agent tailnet dial (#6199)

This commit is contained in:
Mathias Fredriksson
2023-02-14 14:57:48 +00:00
committed by GitHub
parent 5df7872661
commit 41ae01d2e9
5 changed files with 17 additions and 3 deletions
+2
View File
@@ -447,6 +447,8 @@ func (api *API) dialWorkspaceAgentTailnet(r *http.Request, agentID uuid.UUID) (*
Logger: api.Logger.Named("tailnet"),
})
if err != nil {
_ = clientConn.Close()
_ = serverConn.Close()
return nil, xerrors.Errorf("create tailnet conn: %w", err)
}