From 1852616b5efa5840d5c6f9985686c37c10e3e3d4 Mon Sep 17 00:00:00 2001 From: ShyunnY <1147212064@qq.com> Date: Sun, 14 Apr 2024 15:12:36 +0800 Subject: [PATCH] fix: use pointer.Uint32 intead of func()*uint32 Signed-off-by: ShyunnY <1147212064@qq.com> --- .../kubernetes/ratelimit/resource_provider_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/infrastructure/kubernetes/ratelimit/resource_provider_test.go b/internal/infrastructure/kubernetes/ratelimit/resource_provider_test.go index 52aec1fabed..df6f2e8a887 100644 --- a/internal/infrastructure/kubernetes/ratelimit/resource_provider_test.go +++ b/internal/infrastructure/kubernetes/ratelimit/resource_provider_test.go @@ -19,6 +19,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "k8s.io/utils/pointer" "k8s.io/utils/ptr" gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" "sigs.k8s.io/yaml" @@ -677,10 +678,7 @@ func TestDeployment(t *testing.T) { }, Telemetry: &egv1a1.RateLimitTelemetry{ Tracing: &egv1a1.RateLimitTracing{ - SamplingRate: func() *uint32 { - var samplingRate uint32 = 55 - return &samplingRate - }(), + SamplingRate: pointer.Uint32(55), Provider: &egv1a1.RateLimitTracingProvider{ URL: "trace-collector.envoy-gateway-system.svc.cluster.local:4317", },