From 29a3f4acf6074b81136951df92cf468c190d9da9 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Thu, 16 Jun 2022 16:21:49 +0530 Subject: [PATCH] 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 --- internal/controller/persistentvolume/persistentvolume.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/controller/persistentvolume/persistentvolume.go b/internal/controller/persistentvolume/persistentvolume.go index fe2ed5a60..96c21e150 100644 --- a/internal/controller/persistentvolume/persistentvolume.go +++ b/internal/controller/persistentvolume/persistentvolume.go @@ -52,11 +52,11 @@ var ( // Init will add the ReconcilePersistentVolume to the list. func Init() { // add ReconcilePersistentVolume to the list - ctrl.ControllerList = append(ctrl.ControllerList, ReconcilePersistentVolume{}) + ctrl.ControllerList = append(ctrl.ControllerList, &ReconcilePersistentVolume{}) } // 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)) } @@ -132,7 +132,7 @@ func checkStaticVolume(pv *corev1.PersistentVolume) bool { // reconcilePV will extract the image details from the pv spec and regenerates // 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) if !ok { return nil