From aebba51df800cdc80f9b28ee8aef21838a716f5b Mon Sep 17 00:00:00 2001 From: Tom Proctor Date: Fri, 4 Oct 2024 14:22:38 +0100 Subject: [PATCH] Fix rebase issues Signed-off-by: Tom Proctor --- cmd/k8s-operator/egress-services_test.go | 2 +- cmd/k8s-operator/operator.go | 16 ++++++++-------- cmd/k8s-operator/proxygroup.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/k8s-operator/egress-services_test.go b/cmd/k8s-operator/egress-services_test.go index 13fa31784..1adde4e90 100644 --- a/cmd/k8s-operator/egress-services_test.go +++ b/cmd/k8s-operator/egress-services_test.go @@ -34,7 +34,7 @@ func TestTailscaleEgressServices(t *testing.T) { UID: types.UID("1234-UID"), }, Spec: tsapi.ProxyGroupSpec{ - Replicas: pointer.To(3), + Replicas: pointer.To[int32](3), Type: tsapi.ProxyGroupTypeEgress, }, } diff --git a/cmd/k8s-operator/operator.go b/cmd/k8s-operator/operator.go index 1a9fca0a9..d9f5f38da 100644 --- a/cmd/k8s-operator/operator.go +++ b/cmd/k8s-operator/operator.go @@ -356,12 +356,12 @@ func runReconcilers(opts reconcilerOpts) { } egressSvcFilter := handler.EnqueueRequestsFromMapFunc(egressSvcsHandler) - proxyGroupFilter := handler.EnqueueRequestsFromMapFunc(egressSvcsFromEgressProxyGroup(mgr.GetClient(), opts.log)) + egressProxyGroupFilter := handler.EnqueueRequestsFromMapFunc(egressSvcsFromEgressProxyGroup(mgr.GetClient(), opts.log)) err = builder. ControllerManagedBy(mgr). Named("egress-svcs-reconciler"). Watches(&corev1.Service{}, egressSvcFilter). - Watches(&tsapi.ProxyGroup{}, proxyGroupFilter). + Watches(&tsapi.ProxyGroup{}, egressProxyGroupFilter). Complete(&egressSvcsReconciler{ Client: mgr.GetClient(), tsNamespace: opts.tailscaleNamespace, @@ -458,15 +458,15 @@ func runReconcilers(opts reconcilerOpts) { } // Recorder reconciler. - proxyGroupFilter := handler.EnqueueRequestForOwner(mgr.GetScheme(), mgr.GetRESTMapper(), &tsapi.ProxyGroup{}) + ownedByProxyGroupFilter := handler.EnqueueRequestForOwner(mgr.GetScheme(), mgr.GetRESTMapper(), &tsapi.ProxyGroup{}) proxyClassFilterForProxyGroup := handler.EnqueueRequestsFromMapFunc(proxyClassHandlerForProxyGroup(mgr.GetClient(), startlog)) err = builder.ControllerManagedBy(mgr). For(&tsapi.ProxyGroup{}). - Watches(&appsv1.StatefulSet{}, proxyGroupFilter). - Watches(&corev1.ServiceAccount{}, proxyGroupFilter). - Watches(&corev1.Secret{}, proxyGroupFilter). - Watches(&rbacv1.Role{}, proxyGroupFilter). - Watches(&rbacv1.RoleBinding{}, proxyGroupFilter). + Watches(&appsv1.StatefulSet{}, ownedByProxyGroupFilter). + Watches(&corev1.ServiceAccount{}, ownedByProxyGroupFilter). + Watches(&corev1.Secret{}, ownedByProxyGroupFilter). + Watches(&rbacv1.Role{}, ownedByProxyGroupFilter). + Watches(&rbacv1.RoleBinding{}, ownedByProxyGroupFilter). Watches(&tsapi.ProxyClass{}, proxyClassFilterForProxyGroup). Complete(&ProxyGroupReconciler{ recorder: eventRecorder, diff --git a/cmd/k8s-operator/proxygroup.go b/cmd/k8s-operator/proxygroup.go index 0896b7242..3f0358cd4 100644 --- a/cmd/k8s-operator/proxygroup.go +++ b/cmd/k8s-operator/proxygroup.go @@ -415,7 +415,7 @@ func pgTailscaledConfig(pg *tsapi.ProxyGroup, class *tsapi.ProxyClass, idx int32 // For egress proxies only, we need to ensure that stateful filtering is // not in place so that traffic from cluster can be forwarded via // Tailscale IPs. - if pg.Spec.Type == tsapi.ProxyClassTypeEgress { + if pg.Spec.Type == tsapi.ProxyGroupTypeEgress { conf.NoStatefulFiltering = "true" } if shouldAcceptRoutes(class) {