Skip to content

Commit

Permalink
fix(vd): fix panic if pvc not found (#349)
Browse files Browse the repository at this point in the history
fix panic if pvc not found
Signed-off-by: Yaroslav Borbat <86148689+yaroslavborbat@users.noreply.github.com>
  • Loading branch information
yaroslavborbat authored Sep 6, 2024
1 parent 754c4a7 commit fd4b0af
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ func (v *PVCSizeValidator) ValidateUpdate(ctx context.Context, oldVD, newVD *vir
}
// When expanding pvc, the image located in the file system is not enlarged.
// This is why resizing disks in volume mode Filesystem is not supported.
if mode := pvc.Spec.VolumeMode; mode != nil &&
*mode == corev1.PersistentVolumeFilesystem &&
if pvc != nil && pvc.Spec.VolumeMode != nil &&
*pvc.Spec.VolumeMode == corev1.PersistentVolumeFilesystem &&
!oldSize.Equal(newSize) {
return nil, errors.New("resizing disks in volume mode Filesystem is not supported")
}
Expand Down

0 comments on commit fd4b0af

Please sign in to comment.