Skip to content

Commit

Permalink
More CR fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
  • Loading branch information
arnongilboa committed Nov 7, 2023
1 parent 5392808 commit 5386a44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pkg/controller/common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,7 @@ func GetSnapshotClassForSmartClone(pvc *corev1.PersistentVolumeClaim, targetPvcS
}

// GetVolumeSnapshotClass looks up the snapshot class based on the driver and an optional specific name
// In case of multiple candidates, it returns the default-annotated one, or the sorted list first one if no such default
func GetVolumeSnapshotClass(ctx context.Context, c client.Client, pvc *corev1.PersistentVolumeClaim, driver string, snapshotClassName *string, log logr.Logger, recorder record.EventRecorder) (*string, error) {
logger := log.WithName("GetVolumeSnapshotClass").V(3)

Expand All @@ -1933,7 +1934,7 @@ func GetVolumeSnapshotClass(ctx context.Context, c client.Client, pvc *corev1.Pe
}
if vsc.Driver == driver {
logEvent(MessageStorageProfileVolumeSnapshotClassSelected, vsc.Name)
return &vsc.Name, nil
return snapshotClassName, nil
}
return nil, nil
}
Expand All @@ -1951,7 +1952,8 @@ func GetVolumeSnapshotClass(ctx context.Context, c client.Client, pvc *corev1.Pe
if vsc.Driver == driver {
if vsc.Annotations[AnnDefaultSnapshotClass] == "true" {
logEvent(MessageDefaultVolumeSnapshotClassSelected, vsc.Name)
return &vsc.Name, nil
vscName := vsc.Name
return &vscName, nil
}
candidates = append(candidates, vsc.Name)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/storageprofile-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func NewStorageProfileController(mgr manager.Manager, log logr.Logger, installer
}

storageProfileController, err := controller.New(
dataImportControllerName,
storageProfileControllerName,
mgr,
controller.Options{Reconciler: reconciler, MaxConcurrentReconciles: 3})
if err != nil {
Expand Down

0 comments on commit 5386a44

Please sign in to comment.