diff --git a/pkg/models/resources/v1alpha2/storageclass/storageclasses.go b/pkg/models/resources/v1alpha2/storageclass/storageclasses.go index fa651e1e4..9c04aa1b3 100644 --- a/pkg/models/resources/v1alpha2/storageclass/storageclasses.go +++ b/pkg/models/resources/v1alpha2/storageclass/storageclasses.go @@ -107,7 +107,7 @@ func (s *storageClassesSearcher) countPersistentVolumeClaims(name string) int { var count int for _, pvc := range pvcs { - if *pvc.Spec.StorageClassName == name || (pvc.Annotations != nil && pvc.Annotations[corev1.BetaStorageClassAnnotation] == name) { + if (pvc.Spec.StorageClassName != nil && *pvc.Spec.StorageClassName == name) || (pvc.Annotations != nil && pvc.Annotations[corev1.BetaStorageClassAnnotation] == name) { count++ } }