From 5e9d87738a917d1feb7503be194ecdded09387f6 Mon Sep 17 00:00:00 2001 From: Marco Vito Moscaritolo Date: Mon, 16 Oct 2023 11:12:00 +0200 Subject: [PATCH] chore: move internal function to private (#154) --- internal/k8s/ingress.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/k8s/ingress.go b/internal/k8s/ingress.go index 0251e1e..4a6eefd 100644 --- a/internal/k8s/ingress.go +++ b/internal/k8s/ingress.go @@ -31,7 +31,7 @@ func WatchIngresses(options IngressParams, funcs IngressHandlers) cache.SharedIn AddFunc: func(obj interface{}) { ingress, ok := obj.(*networkingv1.Ingress) - if ok && IsControllerIngress(options, ingress) { + if ok && isControllerIngress(options, ingress) { funcs.AddFunc(ingress) } }, @@ -39,14 +39,14 @@ func WatchIngresses(options IngressParams, funcs IngressHandlers) cache.SharedIn oldIng, ok1 := oldObj.(*networkingv1.Ingress) newIng, ok2 := newObj.(*networkingv1.Ingress) - if ok1 && ok2 && IsControllerIngress(options, newIng) { + if ok1 && ok2 && isControllerIngress(options, newIng) { funcs.UpdateFunc(oldIng, newIng) } }, DeleteFunc: func(obj interface{}) { ingress, ok := obj.(*networkingv1.Ingress) - if ok && IsControllerIngress(options, ingress) { + if ok && isControllerIngress(options, ingress) { funcs.DeleteFunc(ingress) } }, @@ -55,8 +55,8 @@ func WatchIngresses(options IngressParams, funcs IngressHandlers) cache.SharedIn return informer } -// IsControllerIngress check if the ingress object can be controlled by us -func IsControllerIngress(options IngressParams, ingress *networkingv1.Ingress) bool { +// isControllerIngress check if the ingress object can be controlled by us +func isControllerIngress(options IngressParams, ingress *networkingv1.Ingress) bool { ingressClass := ingress.Annotations["kubernetes.io/ingress.class"] if ingressClass == "" && ingress.Spec.IngressClassName != nil { ingressClass = *ingress.Spec.IngressClassName