Skip to content

Commit

Permalink
cleanup: ReconcilePersistentVolume consider passing it by pointer
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Prasanna Kumar Kalever authored and mergify[bot] committed Jun 28, 2022
1 parent af0bdaf commit 29a3f4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/controller/persistentvolume/persistentvolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 29a3f4a

Please sign in to comment.