Skip to content

Commit

Permalink
chore: Remove custom code for non leader-elected controllers (#383)
Browse files Browse the repository at this point in the history
We've PR'd this change upstream and it has made it in now. This means we
can remove the custom code we had for it.
  • Loading branch information
jonstacks authored May 29, 2024
1 parent e51cb09 commit 4d03876
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 59 deletions.
13 changes: 0 additions & 13 deletions internal/controller/ingress/non_leader_elected_controller.go

This file was deleted.

44 changes: 0 additions & 44 deletions internal/controller/ingress/non_leader_elected_controller_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions internal/controller/ingress/tunnel_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/ngrok/kubernetes-ingress-controller/pkg/tunneldriver"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/record"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
Expand Down Expand Up @@ -77,13 +78,12 @@ func (r *TunnelReconciler) SetupWithManager(mgr ctrl.Manager) error {
LogConstructor: func(_ *reconcile.Request) logr.Logger {
return r.Log
},
NeedLeaderElection: ptr.To(false),
})
if err != nil {
return err
}

cont = NonLeaderElectedController{cont}

if err := cont.Watch(
source.Kind(mgr.GetCache(), &ingressv1alpha1.Tunnel{}),
&handler.EnqueueRequestForObject{},
Expand Down

0 comments on commit 4d03876

Please sign in to comment.