cleanup: ReconcilePersistentVolume consider passing it by pointer

Address: hugeParam linter

internal/controller/persistentvolume/persistentvolume.go:59:7:
hugeParam: r is heavy (80 bytes); consider passing it by pointer
(gocritic)
[...]
internal/controller/persistentvolume/persistentvolume.go:135:7:
hugeParam: r is heavy (80 bytes); consider passing it by pointer
(gocritic)
func (r ReconcilePersistentVolume) reconcilePV(ctx context.Context, obj
runtime.Object) error {}

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
Prasanna Kumar Kalever 2022-06-16 16:21:49 +05:30 committed by mergify[bot]
parent af0bdaf2cb
commit 29a3f4acf6

View File

@ -52,11 +52,11 @@ var (
// Init will add the ReconcilePersistentVolume to the list. // Init will add the ReconcilePersistentVolume to the list.
func Init() { func Init() {
// add ReconcilePersistentVolume to the list // add ReconcilePersistentVolume to the list
ctrl.ControllerList = append(ctrl.ControllerList, ReconcilePersistentVolume{}) ctrl.ControllerList = append(ctrl.ControllerList, &ReconcilePersistentVolume{})
} }
// Add adds the newPVReconciler. // Add adds the newPVReconciler.
func (r ReconcilePersistentVolume) Add(mgr manager.Manager, config ctrl.Config) error { func (r *ReconcilePersistentVolume) Add(mgr manager.Manager, config ctrl.Config) error {
return add(mgr, newPVReconciler(mgr, config)) return add(mgr, newPVReconciler(mgr, config))
} }
@ -132,7 +132,7 @@ func checkStaticVolume(pv *corev1.PersistentVolume) bool {
// reconcilePV will extract the image details from the pv spec and regenerates // reconcilePV will extract the image details from the pv spec and regenerates
// the omap data. // the omap data.
func (r ReconcilePersistentVolume) reconcilePV(ctx context.Context, obj runtime.Object) error { func (r *ReconcilePersistentVolume) reconcilePV(ctx context.Context, obj runtime.Object) error {
pv, ok := obj.(*corev1.PersistentVolume) pv, ok := obj.(*corev1.PersistentVolume)
if !ok { if !ok {
return nil return nil