From ee70752188e4921a1330703894b42534bc98f374 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 17 Sep 2019 13:43:49 +0200 Subject: [PATCH] Exit on connection loss Exist when a driver closes its socket. 1. The attacher caches driver capabilities, which could (in theory) change after driver restart. 2. New driver may not come up for a while and the attacher should not act as leader during this time. --- cmd/csi-attacher/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/csi-attacher/main.go b/cmd/csi-attacher/main.go index 72953b0b7d..4a28f20255 100644 --- a/cmd/csi-attacher/main.go +++ b/cmd/csi-attacher/main.go @@ -105,7 +105,7 @@ func main() { factory := informers.NewSharedInformerFactory(clientset, *resync) var handler controller.Handler // Connect to CSI. - csiConn, err := connection.Connect(*csiAddress) + csiConn, err := connection.Connect(*csiAddress, connection.OnConnectionLoss(connection.ExitOnConnectionLoss())) if err != nil { klog.Error(err.Error()) os.Exit(1)