From 8b1729fbc6d79a81746d5acbc6539bd83a2c20fd Mon Sep 17 00:00:00 2001
From: whalecold <zls1129@gmail.com>
Date: Fri, 29 Nov 2024 20:56:14 +0800
Subject: [PATCH] chore: remove deprecated dependence

---
 core/manager/bootstrap.go     |  2 +-
 core/manager/mock/response.go | 22 +++++++++++-----------
 core/xdsresource/cds.go       |  7 ++++---
 core/xdsresource/cds_test.go  |  8 ++++----
 core/xdsresource/eds.go       |  5 +++--
 core/xdsresource/eds_test.go  |  8 ++++----
 core/xdsresource/lds.go       | 11 ++++++-----
 core/xdsresource/lds_test.go  | 20 ++++++++++----------
 core/xdsresource/nds.go       |  4 ++--
 core/xdsresource/nds_test.go  |  8 ++++----
 core/xdsresource/rds.go       |  4 ++--
 core/xdsresource/rds_test.go  |  8 ++++----
 core/xdsresource/testutil.go  | 14 ++++++--------
 go.mod                        |  5 ++---
 go.sum                        |  3 ---
 15 files changed, 63 insertions(+), 66 deletions(-)

diff --git a/core/manager/bootstrap.go b/core/manager/bootstrap.go
index 62c768c..e96fd75 100644
--- a/core/manager/bootstrap.go
+++ b/core/manager/bootstrap.go
@@ -24,8 +24,8 @@ import (
 
 	"github.com/cloudwego/kitex/pkg/klog"
 	v3core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
-	structpb "github.com/golang/protobuf/ptypes/struct"
 	"google.golang.org/protobuf/encoding/protojson"
+	"google.golang.org/protobuf/types/known/structpb"
 )
 
 const (
diff --git a/core/manager/mock/response.go b/core/manager/mock/response.go
index e9c5f66..d8b6446 100644
--- a/core/manager/mock/response.go
+++ b/core/manager/mock/response.go
@@ -18,7 +18,7 @@ package mock
 
 import (
 	discoveryv3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
-	"github.com/golang/protobuf/ptypes/any"
+	"google.golang.org/protobuf/types/known/anypb"
 
 	"github.com/kitex-contrib/xds/core/xdsresource"
 )
@@ -36,7 +36,7 @@ var (
 
 	LdsInbound = &discoveryv3.DiscoveryResponse{
 		VersionInfo: LDSVersion1,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.InboundListener1),
 		},
 		Canary:       false,
@@ -47,7 +47,7 @@ var (
 
 	LdsResp1 = &discoveryv3.DiscoveryResponse{
 		VersionInfo: LDSVersion1,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.Listener1),
 			xdsresource.MarshalAny(xdsresource.Listener2),
 		},
@@ -58,7 +58,7 @@ var (
 	}
 	LdsResp2 = &discoveryv3.DiscoveryResponse{
 		VersionInfo: LDSVersion2,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.Listener2),
 		},
 		Canary:       false,
@@ -84,7 +84,7 @@ var (
 
 	RdsResp1 = &discoveryv3.DiscoveryResponse{
 		VersionInfo: RDSVersion1,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.RouteConfig1),
 			xdsresource.MarshalAny(xdsresource.RouteConfig2),
 		},
@@ -95,7 +95,7 @@ var (
 	}
 	RdsResp2 = &discoveryv3.DiscoveryResponse{
 		VersionInfo: RDSVersion2,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.RouteConfig2),
 		},
 		Canary:       false,
@@ -114,7 +114,7 @@ var (
 
 	CdsResp1 = &discoveryv3.DiscoveryResponse{
 		VersionInfo: CDSVersion1,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.Cluster1),
 			xdsresource.MarshalAny(xdsresource.Cluster2),
 		},
@@ -125,7 +125,7 @@ var (
 	}
 	CdsResp2 = &discoveryv3.DiscoveryResponse{
 		VersionInfo: CDSVersion2,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.Cluster2),
 		},
 		Canary:       false,
@@ -144,7 +144,7 @@ var (
 
 	EdsResp1 = &discoveryv3.DiscoveryResponse{
 		VersionInfo: EDSVersion1,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.Endpoints1),
 			xdsresource.MarshalAny(xdsresource.Endpoints2),
 		},
@@ -155,7 +155,7 @@ var (
 	}
 	EdsResp2 = &discoveryv3.DiscoveryResponse{
 		VersionInfo: EDSVersion2,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.Endpoints2),
 		},
 		Canary:       false,
@@ -171,7 +171,7 @@ var (
 	NDSNonce1   = "nonce1"
 	NdsResp1    = &discoveryv3.DiscoveryResponse{
 		VersionInfo: NDSVersion1,
-		Resources: []*any.Any{
+		Resources: []*anypb.Any{
 			xdsresource.MarshalAny(xdsresource.NameTable1),
 		},
 		Canary:       false,
diff --git a/core/xdsresource/cds.go b/core/xdsresource/cds.go
index 2721867..b412ab3 100644
--- a/core/xdsresource/cds.go
+++ b/core/xdsresource/cds.go
@@ -21,7 +21,8 @@ import (
 	"fmt"
 
 	v3clusterpb "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
-	"github.com/golang/protobuf/ptypes/any"
+	"google.golang.org/protobuf/types/known/anypb"
+
 	"google.golang.org/protobuf/proto"
 )
 
@@ -91,7 +92,7 @@ func (c *ClusterResource) InlineEDS() *EndpointsResource {
 	return c.InlineEndpoints
 }
 
-func unmarshalCluster(r *any.Any) (string, *ClusterResource, error) {
+func unmarshalCluster(r *anypb.Any) (string, *ClusterResource, error) {
 	if r.GetTypeUrl() != ClusterTypeURL {
 		return "", nil, fmt.Errorf("invalid cluster resource type: %s", r.GetTypeUrl())
 	}
@@ -123,7 +124,7 @@ func unmarshalCluster(r *any.Any) (string, *ClusterResource, error) {
 	return c.Name, ret, nil
 }
 
-func UnmarshalCDS(rawResources []*any.Any) (map[string]Resource, error) {
+func UnmarshalCDS(rawResources []*anypb.Any) (map[string]Resource, error) {
 	ret := make(map[string]Resource, len(rawResources))
 	errMap := make(map[string]error)
 	var errSlice []error
diff --git a/core/xdsresource/cds_test.go b/core/xdsresource/cds_test.go
index c76c94a..1f70aa8 100644
--- a/core/xdsresource/cds_test.go
+++ b/core/xdsresource/cds_test.go
@@ -20,14 +20,14 @@ import (
 	"reflect"
 	"testing"
 
-	"github.com/golang/protobuf/ptypes/any"
 	"github.com/stretchr/testify/assert"
+	"google.golang.org/protobuf/types/known/anypb"
 )
 
 func TestUnmarshalCDSError(t *testing.T) {
 	tests := []struct {
 		name         string
-		rawResources []*any.Any
+		rawResources []*anypb.Any
 		want         map[string]Resource
 		wantErr      bool
 	}{
@@ -39,7 +39,7 @@ func TestUnmarshalCDSError(t *testing.T) {
 		},
 		{
 			name: "incorrect resource type url",
-			rawResources: []*any.Any{
+			rawResources: []*anypb.Any{
 				{TypeUrl: ListenerTypeURL, Value: []byte{}},
 			},
 			want:    map[string]Resource{},
@@ -61,7 +61,7 @@ func TestUnmarshalCDSError(t *testing.T) {
 }
 
 func TestUnmarshalCDSSuccess(t *testing.T) {
-	rawResources := []*any.Any{
+	rawResources := []*anypb.Any{
 		MarshalAny(Cluster1),
 	}
 	got, err := UnmarshalCDS(rawResources)
diff --git a/core/xdsresource/eds.go b/core/xdsresource/eds.go
index 4ce7f6d..019f5bd 100644
--- a/core/xdsresource/eds.go
+++ b/core/xdsresource/eds.go
@@ -23,7 +23,8 @@ import (
 	"strconv"
 
 	v3endpointpb "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3"
-	"github.com/golang/protobuf/ptypes/any"
+	"google.golang.org/protobuf/types/known/anypb"
+
 	"google.golang.org/protobuf/proto"
 
 	"github.com/cloudwego/kitex/pkg/utils"
@@ -100,7 +101,7 @@ func parseClusterLoadAssignment(cla *v3endpointpb.ClusterLoadAssignment) (*Endpo
 	}, nil
 }
 
-func UnmarshalEDS(rawResources []*any.Any) (map[string]Resource, error) {
+func UnmarshalEDS(rawResources []*anypb.Any) (map[string]Resource, error) {
 	ret := make(map[string]Resource, len(rawResources))
 	errMap := make(map[string]error)
 	var errSlice []error
diff --git a/core/xdsresource/eds_test.go b/core/xdsresource/eds_test.go
index 4b40999..be077b7 100644
--- a/core/xdsresource/eds_test.go
+++ b/core/xdsresource/eds_test.go
@@ -21,14 +21,14 @@ import (
 	"strconv"
 	"testing"
 
-	"github.com/golang/protobuf/ptypes/any"
 	"github.com/stretchr/testify/assert"
+	"google.golang.org/protobuf/types/known/anypb"
 )
 
 func TestUnmarshalEDSError(t *testing.T) {
 	tests := []struct {
 		name         string
-		rawResources []*any.Any
+		rawResources []*anypb.Any
 		want         map[string]Resource
 		wantErr      bool
 	}{
@@ -40,7 +40,7 @@ func TestUnmarshalEDSError(t *testing.T) {
 		},
 		{
 			name: "incorrect resource type url",
-			rawResources: []*any.Any{
+			rawResources: []*anypb.Any{
 				{TypeUrl: ListenerTypeURL, Value: []byte{}},
 			},
 			want:    map[string]Resource{},
@@ -65,7 +65,7 @@ func TestUnmarshalEDSSuccess(t *testing.T) {
 	// edsAddr := "127.0.0.1"
 	// edsPort1, edsPort2 := 8080, 8081
 	// edsWeight1, edsWeight2 := 50, 50
-	rawResources := []*any.Any{
+	rawResources := []*anypb.Any{
 		MarshalAny(Endpoints1),
 	}
 	got, err := UnmarshalEDS(rawResources)
diff --git a/core/xdsresource/lds.go b/core/xdsresource/lds.go
index 11f3c84..0959008 100644
--- a/core/xdsresource/lds.go
+++ b/core/xdsresource/lds.go
@@ -19,13 +19,14 @@ package xdsresource
 import (
 	"fmt"
 
-	udpatypev1 "github.com/cncf/udpa/go/udpa/type/v1"
+	udpatypev1 "github.com/cncf/xds/go/udpa/type/v1"
 	v3listenerpb "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3"
 	v3routepb "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
 	ratelimitv3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/local_ratelimit/v3"
 	v3httppb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3"
 	v3thrift_proxy "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/thrift_proxy/v3"
-	"github.com/golang/protobuf/ptypes/any"
+	"google.golang.org/protobuf/types/known/anypb"
+
 	"google.golang.org/protobuf/proto"
 )
 
@@ -60,7 +61,7 @@ type NetworkFilter struct {
 // UnmarshalLDS unmarshalls the LDS Response.
 // Only focus on OutboundListener now.
 // Get the InlineRouteConfig or RouteConfigName from the listener.
-func UnmarshalLDS(rawResources []*any.Any) (map[string]*ListenerResource, error) {
+func UnmarshalLDS(rawResources []*anypb.Any) (map[string]*ListenerResource, error) {
 	ret := make(map[string]*ListenerResource, len(rawResources))
 	errMap := make(map[string]error)
 	var errSlice []error
@@ -150,7 +151,7 @@ func unmarshalFilterChain(fc *v3listenerpb.FilterChain) ([]*NetworkFilter, error
 	return filters, combineErrors(errSlice)
 }
 
-func unmarshalThriftProxy(rawResources *any.Any) (*RouteConfigResource, error) {
+func unmarshalThriftProxy(rawResources *anypb.Any) (*RouteConfigResource, error) {
 	tp := &v3thrift_proxy.ThriftProxy{}
 	if err := proto.Unmarshal(rawResources.GetValue(), tp); err != nil {
 		return nil, fmt.Errorf("unmarshal HttpConnectionManager failed: %s", err)
@@ -201,7 +202,7 @@ func unmarshalThriftProxy(rawResources *any.Any) (*RouteConfigResource, error) {
 	}, nil
 }
 
-func unmarshallHTTPConnectionManager(rawResources *any.Any) (string, *RouteConfigResource, error) {
+func unmarshallHTTPConnectionManager(rawResources *anypb.Any) (string, *RouteConfigResource, error) {
 	httpConnMng := &v3httppb.HttpConnectionManager{}
 
 	if err := proto.Unmarshal(rawResources.GetValue(), httpConnMng); err != nil {
diff --git a/core/xdsresource/lds_test.go b/core/xdsresource/lds_test.go
index a41f7c6..604c313 100644
--- a/core/xdsresource/lds_test.go
+++ b/core/xdsresource/lds_test.go
@@ -20,22 +20,22 @@ import (
 	"reflect"
 	"testing"
 
-	udpatypev1 "github.com/cncf/udpa/go/udpa/type/v1"
+	udpatypev1 "github.com/cncf/xds/go/udpa/type/v1"
 	v3routepb "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
 	ratelimitv3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/local_ratelimit/v3"
 	v3httppb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3"
 	v3 "github.com/envoyproxy/go-control-plane/envoy/type/v3"
-	"github.com/golang/protobuf/ptypes/any"
-	_struct "github.com/golang/protobuf/ptypes/struct"
-	wrappers "github.com/golang/protobuf/ptypes/wrappers"
+	"google.golang.org/protobuf/types/known/anypb"
+
 	"github.com/stretchr/testify/assert"
 	"google.golang.org/protobuf/types/known/structpb"
+	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
 )
 
 func TestUnmarshalLDSError(t *testing.T) {
 	tests := []struct {
 		name         string
-		rawResources []*any.Any
+		rawResources []*anypb.Any
 		want         map[string]*ListenerResource
 		wantErr      bool
 	}{
@@ -47,7 +47,7 @@ func TestUnmarshalLDSError(t *testing.T) {
 		},
 		{
 			name: "incorrect resource type url",
-			rawResources: []*any.Any{
+			rawResources: []*anypb.Any{
 				{TypeUrl: EndpointTypeURL, Value: []byte{}},
 			},
 			want:    map[string]*ListenerResource{},
@@ -69,7 +69,7 @@ func TestUnmarshalLDSError(t *testing.T) {
 }
 
 func TestUnmarshalLDSHttpConnectionManager(t *testing.T) {
-	rawResources := []*any.Any{
+	rawResources := []*anypb.Any{
 		MarshalAny(Listener1),
 		MarshalAny(Listener2),
 	}
@@ -96,7 +96,7 @@ func TestUnmarshalLDSHttpConnectionManager(t *testing.T) {
 }
 
 func TestUnmarshallLDSThriftProxy(t *testing.T) {
-	rawResources := []*any.Any{
+	rawResources := []*anypb.Any{
 		MarshalAny(Listener3),
 	}
 	res, err := UnmarshalLDS(rawResources)
@@ -147,7 +147,7 @@ func TestGetLocalRateLimitFromHttpConnectionManager(t *testing.T) {
 	rateLimit := &ratelimitv3.LocalRateLimit{
 		TokenBucket: &v3.TokenBucket{
 			MaxTokens: 10,
-			TokensPerFill: &wrappers.UInt32Value{
+			TokensPerFill: &wrapperspb.UInt32Value{
 				Value: 10,
 			},
 		},
@@ -174,7 +174,7 @@ func TestGetLocalRateLimitFromHttpConnectionManager(t *testing.T) {
 	// ---------------------------------- struct ratelimit ------------------------------------
 	structLimit := &udpatypev1.TypedStruct{
 		TypeUrl: RateLimitTypeURL,
-		Value: &_struct.Struct{
+		Value: &structpb.Struct{
 			Fields: map[string]*structpb.Value{
 				"token_bucket": {
 					Kind: &structpb.Value_StructValue{
diff --git a/core/xdsresource/nds.go b/core/xdsresource/nds.go
index 8784a5d..008591f 100644
--- a/core/xdsresource/nds.go
+++ b/core/xdsresource/nds.go
@@ -19,8 +19,8 @@ package xdsresource
 import (
 	"fmt"
 
-	"github.com/golang/protobuf/ptypes/any"
 	"google.golang.org/protobuf/proto"
+	"google.golang.org/protobuf/types/known/anypb"
 
 	dnsProto "github.com/kitex-contrib/xds/core/api/kitex_gen/istio.io/istio/pkg/dns/proto/istio_networking_nds_v1"
 )
@@ -29,7 +29,7 @@ type NDSResource struct {
 	NameTable map[string][]string
 }
 
-func UnmarshalNDS(rawResources []*any.Any) (*NDSResource, error) {
+func UnmarshalNDS(rawResources []*anypb.Any) (*NDSResource, error) {
 	if len(rawResources) < 1 {
 		return nil, fmt.Errorf("no NDS resource found in the response")
 	}
diff --git a/core/xdsresource/nds_test.go b/core/xdsresource/nds_test.go
index f6fc5fc..462814f 100644
--- a/core/xdsresource/nds_test.go
+++ b/core/xdsresource/nds_test.go
@@ -22,14 +22,14 @@ import (
 
 	"github.com/stretchr/testify/assert"
 
-	"github.com/golang/protobuf/ptypes/any"
+	"google.golang.org/protobuf/types/known/anypb"
 
 	dnsProto "github.com/kitex-contrib/xds/core/api/kitex_gen/istio.io/istio/pkg/dns/proto/istio_networking_nds_v1"
 )
 
 func TestUnmarshalNDSError(t *testing.T) {
 	type args struct {
-		rawResources []*any.Any
+		rawResources []*anypb.Any
 	}
 	tests := []struct {
 		name    string
@@ -48,7 +48,7 @@ func TestUnmarshalNDSError(t *testing.T) {
 		{
 			name: "incorrect resource type url",
 			args: args{
-				[]*any.Any{
+				[]*anypb.Any{
 					{TypeUrl: ListenerTypeURL, Value: []byte{}},
 				},
 			},
@@ -79,7 +79,7 @@ func TestUnmarshalNDSSuccess(t *testing.T) {
 			},
 		},
 	}
-	rawResources := []*any.Any{
+	rawResources := []*anypb.Any{
 		MarshalAny(nt),
 	}
 	res, err := UnmarshalNDS(rawResources)
diff --git a/core/xdsresource/rds.go b/core/xdsresource/rds.go
index 2f70a0b..dd7f71a 100644
--- a/core/xdsresource/rds.go
+++ b/core/xdsresource/rds.go
@@ -24,8 +24,8 @@ import (
 	"time"
 
 	v3routepb "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
-	"github.com/golang/protobuf/ptypes/any"
 	"google.golang.org/protobuf/proto"
+	"google.golang.org/protobuf/types/known/anypb"
 )
 
 const (
@@ -247,7 +247,7 @@ func unmarshalRouteConfig(routeConfig *v3routepb.RouteConfiguration) (*RouteConf
 	}, nil
 }
 
-func UnmarshalRDS(rawResources []*any.Any) (map[string]Resource, error) {
+func UnmarshalRDS(rawResources []*anypb.Any) (map[string]Resource, error) {
 	ret := make(map[string]Resource, len(rawResources))
 	errMap := make(map[string]error)
 	var errSlice []error
diff --git a/core/xdsresource/rds_test.go b/core/xdsresource/rds_test.go
index 75f6c7c..7ca5086 100644
--- a/core/xdsresource/rds_test.go
+++ b/core/xdsresource/rds_test.go
@@ -23,14 +23,14 @@ import (
 	"github.com/stretchr/testify/assert"
 
 	v3routepb "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
-	"github.com/golang/protobuf/ptypes/any"
+	"google.golang.org/protobuf/types/known/anypb"
 	"google.golang.org/protobuf/types/known/wrapperspb"
 )
 
 func TestUnmarshalRDSError(t *testing.T) {
 	tests := []struct {
 		name         string
-		rawResources []*any.Any
+		rawResources []*anypb.Any
 		want         map[string]Resource
 		wantErr      bool
 	}{
@@ -42,7 +42,7 @@ func TestUnmarshalRDSError(t *testing.T) {
 		},
 		{
 			name: "incorrect resource type url",
-			rawResources: []*any.Any{
+			rawResources: []*anypb.Any{
 				{TypeUrl: EndpointTypeURL, Value: []byte{}},
 			},
 			want:    map[string]Resource{},
@@ -69,7 +69,7 @@ func TestUnmarshalRDSSuccess(t *testing.T) {
 		vhName          = "vh"
 		path            = "test"
 	)
-	rawResources := []*any.Any{
+	rawResources := []*anypb.Any{
 		MarshalAny(&v3routepb.RouteConfiguration{
 			Name: routeConfigName,
 			VirtualHosts: []*v3routepb.VirtualHost{
diff --git a/core/xdsresource/testutil.go b/core/xdsresource/testutil.go
index c45054e..dbc5e53 100644
--- a/core/xdsresource/testutil.go
+++ b/core/xdsresource/testutil.go
@@ -27,8 +27,6 @@ import (
 	v3thrift_proxy "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/thrift_proxy/v3"
 	v3matcher "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"
 	typedv3 "github.com/envoyproxy/go-control-plane/envoy/type/v3"
-	"github.com/golang/protobuf/ptypes/any"
-	"github.com/golang/protobuf/ptypes/wrappers"
 	"google.golang.org/protobuf/proto"
 	"google.golang.org/protobuf/types/known/anypb"
 	"google.golang.org/protobuf/types/known/wrapperspb"
@@ -36,7 +34,7 @@ import (
 	dnsProto "github.com/kitex-contrib/xds/core/api/kitex_gen/istio.io/istio/pkg/dns/proto/istio_networking_nds_v1"
 )
 
-func MarshalAny(message proto.Message) *any.Any {
+func MarshalAny(message proto.Message) *anypb.Any {
 	a, _ := anypb.New(message)
 	return a
 }
@@ -107,7 +105,7 @@ var (
 	rateLimit = &ratelimitv3.LocalRateLimit{
 		TokenBucket: &typedv3.TokenBucket{
 			MaxTokens: 10,
-			TokensPerFill: &wrappers.UInt32Value{
+			TokensPerFill: &wrapperspb.UInt32Value{
 				Value: 101,
 			},
 		},
@@ -330,10 +328,10 @@ var (
 		},
 		LbPolicy: v3clusterpb.Cluster_ROUND_ROBIN,
 		OutlierDetection: &v3clusterpb.OutlierDetection{
-			FailurePercentageThreshold: &wrappers.UInt32Value{
+			FailurePercentageThreshold: &wrapperspb.UInt32Value{
 				Value: 10,
 			},
-			FailurePercentageRequestVolume: &wrappers.UInt32Value{
+			FailurePercentageRequestVolume: &wrapperspb.UInt32Value{
 				Value: 100,
 			},
 		},
@@ -346,10 +344,10 @@ var (
 			ServiceName: EndpointName1,
 		},
 		OutlierDetection: &v3clusterpb.OutlierDetection{
-			FailurePercentageThreshold: &wrappers.UInt32Value{
+			FailurePercentageThreshold: &wrapperspb.UInt32Value{
 				Value: 10,
 			},
-			FailurePercentageRequestVolume: &wrappers.UInt32Value{
+			FailurePercentageRequestVolume: &wrapperspb.UInt32Value{
 				Value: 0,
 			},
 		},
diff --git a/go.mod b/go.mod
index a0529a1..676c2c7 100644
--- a/go.mod
+++ b/go.mod
@@ -6,9 +6,8 @@ require (
 	github.com/bytedance/gopkg v0.1.1
 	github.com/cenkalti/backoff/v4 v4.1.0
 	github.com/cloudwego/kitex v0.11.3
-	github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe
+	github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4
 	github.com/envoyproxy/go-control-plane v0.11.1
-	github.com/golang/protobuf v1.5.3
 	github.com/google/go-cmp v0.5.9
 	github.com/stretchr/testify v1.9.0
 	go.uber.org/atomic v1.11.0
@@ -32,10 +31,10 @@ require (
 	github.com/cloudwego/netpoll v0.6.4 // indirect
 	github.com/cloudwego/runtimex v0.1.0 // indirect
 	github.com/cloudwego/thriftgo v0.3.17 // indirect
-	github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect
 	github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
 	github.com/envoyproxy/protoc-gen-validate v1.0.1 // indirect
 	github.com/fatih/structtag v1.2.0 // indirect
+	github.com/golang/protobuf v1.5.3 // indirect
 	github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
 	github.com/iancoleman/strcase v0.2.0 // indirect
 	github.com/jhump/protoreflect v1.8.2 // indirect
diff --git a/go.sum b/go.sum
index 9d06d9e..bb2b739 100644
--- a/go.sum
+++ b/go.sum
@@ -42,9 +42,6 @@ github.com/cloudwego/runtimex v0.1.0 h1:HG+WxWoj5/CDChDZ7D99ROwvSMkuNXAqt6hnhTTZ
 github.com/cloudwego/runtimex v0.1.0/go.mod h1:23vL/HGV0W8nSCHbe084AgEBdDV4rvXenEUMnUNvUd8=
 github.com/cloudwego/thriftgo v0.3.17 h1:k0iQe2jEAN1WhPsXWvatwHzoxObUSX2Nw5NqdnywS8k=
 github.com/cloudwego/thriftgo v0.3.17/go.mod h1:AdLEJJVGW/ZJYvkkYAZf5SaJH+pA3OyC801WSwqcBwI=
-github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk=
-github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
-github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
 github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=
 github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=