From c35e724eac6114ef570c1c5a2d45d4e8f38703f8 Mon Sep 17 00:00:00 2001 From: Andrey Klimentyev Date: Thu, 19 Jan 2023 13:39:30 +0300 Subject: [PATCH] Fixed missing defer on locking on ListRoute operation (#49) --- pkg/cloudprovider/yandex/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cloudprovider/yandex/routes.go b/pkg/cloudprovider/yandex/routes.go index 4abe2a2..2c421d5 100644 --- a/pkg/cloudprovider/yandex/routes.go +++ b/pkg/cloudprovider/yandex/routes.go @@ -27,7 +27,7 @@ func (yc *Cloud) ListRoutes(ctx context.Context, _ string) ([]*cloudprovider.Rou klog.Info("ListRoutes called") if routeAPILock.TryLock() { - routeAPILock.Unlock() + defer routeAPILock.Unlock() } else { return nil, errors.New("VPC route API locked") }