Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Avinash Patnala <avinashpatnala@google.com>
  • Loading branch information
Avinash Patnala committed Sep 20, 2024
1 parent 60ec8d5 commit a871c3b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/config/config_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
}

err = c.Watch(
source.Kind(mgr.GetCache(), &statusv1beta1.ConfigPodStatus{}, handler.TypedEnqueueRequestsFromMapFunc(configstatus.PodStatusToConfigMapper(true, util.EventPackerMapFunc()))))
source.Kind(mgr.GetCache(), &statusv1beta1.ConfigPodStatus{}, handler.TypedEnqueueRequestsFromMapFunc(configstatus.PodStatusToConfigMapper(true))))
if err != nil {
return err
}
Expand Down
6 changes: 2 additions & 4 deletions pkg/controller/configstatus/configstatus_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ func newReconciler(mgr manager.Manager) reconcile.Reconciler {
}
}

type PackerMap func(obj client.Object) []reconcile.Request

// PodStatusToConfigMapper correlates a ConfigPodStatus with its corresponding Config.
// `selfOnly` tells the mapper to only map statuses corresponding to the current pod.
func PodStatusToConfigMapper(selfOnly bool, packerMap handler.MapFunc) handler.TypedMapFunc[*v1beta1.ConfigPodStatus] {
func PodStatusToConfigMapper(selfOnly bool) handler.TypedMapFunc[*v1beta1.ConfigPodStatus] {
return func(_ context.Context, obj *v1beta1.ConfigPodStatus) []reconcile.Request {
labels := obj.GetLabels()
name, ok := labels[v1beta1.ConfigNameLabel]
Expand Down Expand Up @@ -109,7 +107,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
}

err = c.Watch(
source.Kind(mgr.GetCache(), &v1beta1.ConfigPodStatus{}, handler.TypedEnqueueRequestsFromMapFunc(PodStatusToConfigMapper(false, util.EventPackerMapFunc()))))
source.Kind(mgr.GetCache(), &v1beta1.ConfigPodStatus{}, handler.TypedEnqueueRequestsFromMapFunc(PodStatusToConfigMapper(false))))
if err != nil {
return err
}
Expand Down
11 changes: 0 additions & 11 deletions pkg/readiness/ready_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,6 @@ type Tracker struct {
trackListerPredicateOverride retryPredicate
}

type WrapFakeClientWithMutex struct {
listMutex sync.Mutex
fakeLister Lister
}

func (w *WrapFakeClientWithMutex) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error {
w.listMutex.Lock()
defer w.listMutex.Unlock()
return w.fakeLister.List(ctx, list, opts...)
}

// NewTracker creates a new Tracker and initializes the internal trackers.
func NewTracker(lister Lister, mutationEnabled, externalDataEnabled, expansionEnabled bool) *Tracker {
// TODO: Dereference crashOnFailureFetchingExpectations when we change crashOnFailureFetchingExpectations to a flag
Expand Down

0 comments on commit a871c3b

Please sign in to comment.