Skip to content

Commit c85e33a

Browse files
committed
Add comments about processRejectedDevicesForDeviceLinks
1 parent 54da887 commit c85e33a

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

pkg/diskmaker/controllers/lv/reconcile.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,14 @@ func (r *LocalVolumeReconciler) Reconcile(ctx context.Context, request ctrl.Requ
501501
return ctrl.Result{Requeue: true, RequeueAfter: requeueTime}, nil
502502
}
503503

504+
// processRejectedDevicesForDeviceLinks reconciles devices which were rejected for PV creation
505+
// but otherwise matched user specified path in LocalVolume object.
506+
//
507+
// This handles LVDL creation for clusters which were upgraded from older versions of OCP
508+
// and also updates preferredSymlink, fileSystemUUID and validLinks for PVs which are already
509+
// mounted and in-use by kubelet.
510+
//
511+
// This function is called periodically with Reconcile loop every defaultRequeueTime (1 minute)
504512
func (r *LocalVolumeReconciler) processRejectedDevicesForDeviceLinks(ctx context.Context, rejectedDevices map[string][]internal.DiskLocation) {
505513
for storageClassName, diskLocationArray := range rejectedDevices {
506514
symLinkDirPath := path.Join(r.symlinkLocation, storageClassName)

pkg/diskmaker/controllers/lv/reconcile_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@ func getFakeDiskMaker(t *testing.T, symlinkLocation string, objs ...runtime.Obje
578578
)
579579

580580
return lvReconciler, tc
581-
582581
}
583582

584583
func getDeiveIDs() []string {

pkg/diskmaker/controllers/lvset/reconcile.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,14 @@ func (r *LocalVolumeSetReconciler) Reconcile(ctx context.Context, request ctrl.R
264264
return ctrl.Result{Requeue: true, RequeueAfter: requeueTime}, nil
265265
}
266266

267+
// processRejectedDevicesForDeviceLinks reconciles devices which were rejected for PV creation
268+
// but otherwise matched user specified path in LocalVolumeSet object.
269+
//
270+
// This handles LVDL creation for clusters which were upgraded from older versions of OCP
271+
// and also updates preferredSymlink, fileSystemUUID and validLinks for PVs which are already
272+
// mounted and in-use by kubelet.
273+
//
274+
// This function is called periodically with Reconcile loop every defaultRequeueTime (1 minute)
267275
func (r *LocalVolumeSetReconciler) processRejectedDevicesForDeviceLinks(ctx context.Context, lvset *localv1alpha1.LocalVolumeSet, rejectedDevices []internal.BlockDevice, symLinkDir, storageClassName string) {
268276
klog.V(2).InfoS("processing rejected devices for LocalVolumeDeviceLink")
269277
for _, blockDevice := range rejectedDevices {

pkg/internal/device_link_handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func NewDeviceLinkHandler(currentSymlink string, client client.Client) *DeviceLi
3434
}
3535
}
3636

37+
// Create creates a LVDL object without fully setting all status fields.
38+
// This can be used before creation of PV during normal provisioning operation and
39+
// status can be updated afterwards.
3740
func (dl *DeviceLinkHandler) Create(ctx context.Context, pvName, namespace string, ownerObj runtime.Object) (*v1.LocalVolumeDeviceLink, error) {
3841
existing := &v1.LocalVolumeDeviceLink{}
3942
key := types.NamespacedName{Name: pvName, Namespace: namespace}

0 commit comments

Comments
 (0)