Skip to content

Commit 6ef07a2

Browse files
julianKatzcemakd
authored andcommitted
Only run device cache if successfully created
1 parent be4b045 commit 6ef07a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/gce-pd-csi-driver/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,9 @@ func handle() {
279279
deviceCache, err := linkcache.NewDeviceCacheForNode(ctx, 1*time.Minute, *nodeName)
280280
if err != nil {
281281
klog.Warningf("Failed to create device cache: %v", err.Error())
282+
} else {
283+
go deviceCache.Run(ctx)
282284
}
283-
go deviceCache.Run(ctx)
284285

285286
// TODO(2042): Move more of the constructor args into this struct
286287
nsArgs := &driver.NodeServerArgs{

0 commit comments

Comments
 (0)