From cbefe738ef85d60671914ceaef68a858b235c6be Mon Sep 17 00:00:00 2001 From: Chad Roberts Date: Tue, 15 Apr 2025 12:59:32 -0400 Subject: [PATCH] Update formatter signature to use the interface to facilitate using a fake for testing --- pkg/resources/common/formatter.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/resources/common/formatter.go b/pkg/resources/common/formatter.go index 9f5b6a2a..a1028dbd 100644 --- a/pkg/resources/common/formatter.go +++ b/pkg/resources/common/formatter.go @@ -7,7 +7,9 @@ import ( "github.com/rancher/apiserver/pkg/types" "github.com/rancher/steve/pkg/accesscontrol" "github.com/rancher/steve/pkg/attributes" + "github.com/rancher/steve/pkg/resources/virtual/common" "github.com/rancher/steve/pkg/schema" + metricsStore "githu metricsStore "github.com/rancher/steve/pkg/stores/metrics" "github.com/rancher/steve/pkg/stores/proxy" "github.com/rancher/steve/pkg/summarycache" @@ -73,7 +75,7 @@ func selfLink(gvr schema2.GroupVersionResource, meta metav1.Object) (prefix stri return buf.String() } -func formatter(summarycache *summarycache.SummaryCache, asl accesscontrol.AccessSetLookup) types.Formatter { +func formatter(summarycache common.SummaryCache, asl accesscontrol.AccessSetLookup) types.Formatter { return func(request *types.APIRequest, resource *types.RawResource) { if resource.Schema == nil { return