Skip to content

Commit 517e64a

Browse files
committed
unit tests
Signed-off-by: Ashima-Ashima1 <[email protected]>
1 parent 47fa1c4 commit 517e64a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

controllers/recoverstalevolume_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ func (r *RecoverStaleVolumeReconciler) Reconcile(ctx context.Context, req ctrl.R
167167
return ctrl.Result{}, err
168168
}
169169

170-
scName := *pvc.Spec.StorageClassName
170+
storageClass := pvc.Spec.StorageClassName
171+
scName := ""
172+
if storageClass != nil {
173+
scName = *storageClass
174+
}
171175
reqLogger.Info("PVC using Storage-class", "pvc-name", pvcName, "sc-name", scName)
172176
// Check if the volume is using csi storage-class
173177
if strings.Contains(scName, "csi") {

0 commit comments

Comments
 (0)