Share Netbird client between all reconcilers (#122)

This changes the reconcilers to take a netbird client rather than
creating their own on setup.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
Philip Laine
2026-03-16 11:23:26 +01:00
committed by GitHub
parent dca7782571
commit 9313fef43d
9 changed files with 58 additions and 74 deletions
@@ -85,7 +85,7 @@ var _ = Describe("NBGroup Controller", func() {
By("Reconciling the created resource")
controllerReconciler := &NBGroupReconciler{
Client: k8sClient,
netbird: netbirdClient,
Netbird: netbirdClient,
}
mux.HandleFunc("/api/groups", func(w http.ResponseWriter, r *http.Request) {
@@ -123,7 +123,7 @@ var _ = Describe("NBGroup Controller", func() {
By("Reconciling the created resource")
controllerReconciler := &NBGroupReconciler{
Client: k8sClient,
netbird: netbirdClient,
Netbird: netbirdClient,
}
mux.HandleFunc("/api/groups", func(w http.ResponseWriter, r *http.Request) {
@@ -172,7 +172,7 @@ var _ = Describe("NBGroup Controller", func() {
By("Reconciling the deleting resource")
controllerReconciler := &NBGroupReconciler{
Client: k8sClient,
netbird: netbirdClient,
Netbird: netbirdClient,
}
method := ""
@@ -198,7 +198,7 @@ var _ = Describe("NBGroup Controller", func() {
By("Reconciling the deleting resource")
controllerReconciler := &NBGroupReconciler{
Client: k8sClient,
netbird: netbirdClient,
Netbird: netbirdClient,
}
method := ""
@@ -239,7 +239,7 @@ var _ = Describe("NBGroup Controller", func() {
By("Reconciling the deleting resource")
controllerReconciler := &NBGroupReconciler{
Client: k8sClient,
netbird: netbirdClient,
Netbird: netbirdClient,
}
method := ""
@@ -266,7 +266,7 @@ var _ = Describe("NBGroup Controller", func() {
It("should re-use existing group ID", func() {
controllerReconciler := &NBGroupReconciler{
Client: k8sClient,
netbird: netbirdClient,
Netbird: netbirdClient,
}
mux.HandleFunc("/api/groups", func(w http.ResponseWriter, r *http.Request) {
@@ -303,7 +303,7 @@ var _ = Describe("NBGroup Controller", func() {
It("Should requeue and create group on next run", func() {
controllerReconciler := &NBGroupReconciler{
Client: k8sClient,
netbird: netbirdClient,
Netbird: netbirdClient,
}
mux.HandleFunc("/api/groups", func(w http.ResponseWriter, r *http.Request) {