Skip to content

Commit

Permalink
Improve controller not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Scaffidi committed Mar 5, 2025
1 parent e4c85e4 commit 78e16f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/util/k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func FindPodController(ctx context.Context, kubeClient kubernetes.Clientset, pod

controller, err := getPodController(ctx, dynamic, res)
if err != nil {
return nil, &ControllerNotFoundError{fmt.Sprintf("Couldn't find controller of pod %v.%v", pod.Name, pod.Namespace)}
return nil, &ControllerNotFoundError{fmt.Sprintf("Couldn't find controller of pod %v.%v: %v", pod.Name, pod.Namespace, err)}
}

log.Info("Found controller for outdated pod", "pod-name", pod.Name, "controller-name", controller.GetName())
Expand Down
2 changes: 1 addition & 1 deletion internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func PodControllerRateLimiter[T comparable]() workqueue.TypedRateLimiter[T] {
limit := rate.Limit(1.0 / (60.0 / restartsPerMinute))
limiter := rate.NewLimiter(limit, activeRestartLimit)
return workqueue.NewTypedMaxOfRateLimiter(
workqueue.NewTypedItemExponentialFailureRateLimiter[T](500*time.Millisecond, 1000*time.Second),
//workqueue.NewTypedItemExponentialFailureRateLimiter[T](500*time.Millisecond, 1000*time.Second),
// This is only for retry speed and its only the overall factor (not per item)
&workqueue.TypedBucketRateLimiter[T]{Limiter: limiter},
)
Expand Down

0 comments on commit 78e16f4

Please sign in to comment.