From e56c2d825518140022101f448d682086fc4c8d1f Mon Sep 17 00:00:00 2001 From: mikutas <23391543+mikutas@users.noreply.github.com> Date: Wed, 18 Oct 2023 08:43:04 +0900 Subject: [PATCH] Remove redundant if branch --- .../pkg/utils/limitrange/limit_range_calculator.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vertical-pod-autoscaler/pkg/utils/limitrange/limit_range_calculator.go b/vertical-pod-autoscaler/pkg/utils/limitrange/limit_range_calculator.go index 27d5954e66b8..e54804a383a9 100644 --- a/vertical-pod-autoscaler/pkg/utils/limitrange/limit_range_calculator.go +++ b/vertical-pod-autoscaler/pkg/utils/limitrange/limit_range_calculator.go @@ -60,9 +60,7 @@ func NewLimitsRangeCalculator(f informers.SharedInformerFactory) (*limitsChecker go informer.Run(stopCh) ok := cache.WaitForCacheSync(stopCh, informer.HasSynced) if !ok { - if !f.Core().V1().LimitRanges().Informer().HasSynced() { - return nil, fmt.Errorf("informer did not sync") - } + return nil, fmt.Errorf("informer did not sync") } return &limitsChecker{limitRangeLister}, nil }