From 3fbead0083a5a639569eed8cf45186087bd21c3e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 16:06:37 +0000 Subject: [PATCH 1/2] Update module github.com/hashicorp/golang-lru to v2 --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 1f85743..a545edc 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/getkin/kin-openapi v0.133.0 github.com/go-logr/logr v1.4.3 github.com/hashicorp/golang-lru v1.0.2 + github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/labstack/echo/v4 v4.15.1 github.com/oapi-codegen/echo-middleware v1.0.2 github.com/oapi-codegen/runtime v1.4.0 From dce8e256137f5ffffd3553f243436d5165fe5d41 Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Tue, 28 Apr 2026 09:16:38 +0200 Subject: [PATCH 2/2] Update code to use `hashicorp/golang-lru/v2` --- go.mod | 1 - go.sum | 2 -- pkg/service/kubernetes_auth.go | 8 ++++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index a545edc..a6e358c 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/AlekSi/pointer v1.2.0 github.com/getkin/kin-openapi v0.133.0 github.com/go-logr/logr v1.4.3 - github.com/hashicorp/golang-lru v1.0.2 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/labstack/echo/v4 v4.15.1 github.com/oapi-codegen/echo-middleware v1.0.2 diff --git a/go.sum b/go.sum index 28480da..a019763 100644 --- a/go.sum +++ b/go.sum @@ -155,8 +155,6 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/hairyhenderson/go-codeowners v0.7.0 h1:s0W4wF8bdsBEjTWzwzSlsatSthWtTAF2xLgo4a4RwAo= github.com/hairyhenderson/go-codeowners v0.7.0/go.mod h1:wUlNgQ3QjqC4z8DnM5nnCYVq/icpqXJyJOukKx5U8/Q= -github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= -github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= diff --git a/pkg/service/kubernetes_auth.go b/pkg/service/kubernetes_auth.go index ccf2485..c146333 100644 --- a/pkg/service/kubernetes_auth.go +++ b/pkg/service/kubernetes_auth.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - lruCache "github.com/hashicorp/golang-lru" + lruCache "github.com/hashicorp/golang-lru/v2" "github.com/labstack/echo/v4" "k8s.io/apimachinery/pkg/util/runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -42,8 +42,8 @@ func getCacheSizeOrDefault(def int) int { return parsed } -func createCache() *lruCache.Cache { - cache, err := lruCache.NewWithEvict(getCacheSizeOrDefault(128), nil) +func createCache() *lruCache.Cache[string, client.Client] { + cache, err := lruCache.NewWithEvict[string, client.Client](getCacheSizeOrDefault(128), nil) runtime.Must(err) return cache } @@ -51,7 +51,7 @@ func createCache() *lruCache.Cache { // KubernetesAuth provides middleware to authenticate with Kubernetes JWT tokens type KubernetesAuth struct { CreateClientFunc func(string) (client.Client, error) - cache *lruCache.Cache + cache *lruCache.Cache[string, client.Client] } // DefaultKubernetesAuth uses the JWT bearer token to authenticate