mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 04:55:22 +00:00
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 <tkaovila@redhat.com>
This commit is contained in:
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user