From 6d0d1aaccc0dbf4fdf3cc7a3b86d08b787cf3ba2 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Wed, 31 Jul 2024 22:18:42 -0400 Subject: [PATCH] tautological condition: non-nil != nil https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/nilness#cond:~:text=p%20%3A%3D%20%26v%0A...%0Aif%20p%20!%3D%20nil%20%7B%20//%20tautological%20condition%0A%7D Signed-off-by: Tiger Kaovilai --- pkg/controller/restore_finalizer_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/restore_finalizer_controller.go b/pkg/controller/restore_finalizer_controller.go index a75ea199a..433f197a9 100644 --- a/pkg/controller/restore_finalizer_controller.go +++ b/pkg/controller/restore_finalizer_controller.go @@ -311,7 +311,7 @@ func (ctx *finalizerContext) patchDynamicPVWithVolumeInfo() (errs results.Result // We are handling a common but specific scenario where a PVC is in a pending state and uses a storage class with // VolumeBindingMode set to WaitForFirstConsumer. In this case, the PV patch step is skipped to avoid // failures due to the PVC not being bound, which could cause a timeout and result in a failed restore. - if pvc != nil && pvc.Status.Phase == v1.ClaimPending { + if pvc.Status.Phase == v1.ClaimPending { // check if storage class used has VolumeBindingMode as WaitForFirstConsumer scName := *pvc.Spec.StorageClassName sc := &storagev1api.StorageClass{}