From d3ddb3c03dd594b2205385733e5d59569d9be95c Mon Sep 17 00:00:00 2001 From: robocanic Date: Sun, 7 Dec 2025 15:39:11 +0800 Subject: [PATCH 1/5] feat: support nacos2 to do discovery --- api/mesh/v1alpha1/instance.pb.go | 163 ++++--- api/mesh/v1alpha1/instance.proto | 15 +- api/mesh/v1alpha1/rpc_instance.pb.go | 223 +++++++-- api/mesh/v1alpha1/rpc_instance.proto | 32 +- api/mesh/v1alpha1/runtime_instance.pb.go | 153 +++--- api/mesh/v1alpha1/runtime_instance.proto | 35 +- .../v1alpha1/service_consumer_metadata.pb.go | 61 ++- .../v1alpha1/service_consumer_metadata.proto | 3 +- .../v1alpha1/service_provider_metadata.pb.go | 330 ++++++++++++- .../v1alpha1/service_provider_metadata.proto | 39 +- app/dubbo-admin/cmd/run.go | 10 +- app/dubbo-admin/dubbo-admin.yaml | 44 +- go.mod | 80 +++- go.sum | 439 ++++++++++++++++-- nacos | 61 +++ pkg/common/bizerror/common.go | 6 +- pkg/common/bizerror/error.go | 22 +- .../constants/constants.go | 19 + pkg/config/discovery/config.go | 42 +- pkg/config/engine/config.go | 19 +- pkg/config/loader.go | 20 +- pkg/console/component.go | 6 +- pkg/console/handler/auth.go | 6 +- pkg/console/handler/observability.go | 2 +- pkg/console/model/application.go | 2 +- pkg/console/model/instance.go | 2 +- pkg/console/service/application.go | 4 +- pkg/console/service/instance.go | 2 +- pkg/console/util/error.go | 4 +- pkg/core/bootstrap/init.go | 1 + pkg/core/discovery/component.go | 79 +++- pkg/core/discovery/subscriber/rpc_instance.go | 187 ++++++++ pkg/core/engine/component.go | 2 +- .../engine/subscriber/runtime_instance.go | 217 ++++++--- pkg/core/events/component.go | 2 +- pkg/core/events/eventbus.go | 30 +- pkg/core/logger/log.go | 9 +- .../apis/mesh/v1alpha1/affinityroute_types.go | 46 +- .../apis/mesh/v1alpha1/application_types.go | 46 +- .../mesh/v1alpha1/conditionroute_types.go | 46 +- .../apis/mesh/v1alpha1/dynamicconfig_types.go | 46 +- .../apis/mesh/v1alpha1/instance_helper.go | 26 ++ .../apis/mesh/v1alpha1/instance_types.go | 46 +- .../apis/mesh/v1alpha1/rpcinstance_types.go | 46 +- .../v1alpha1/rpcinstancemetadata_types.go | 44 +- .../mesh/v1alpha1/runtimeinstance_types.go | 46 +- .../apis/mesh/v1alpha1/service_types.go | 46 +- .../v1alpha1/serviceconsumermetadata_types.go | 46 +- .../v1alpha1/serviceprovidermapping_types.go | 46 +- .../v1alpha1/serviceprovidermetadata_types.go | 46 +- .../apis/mesh/v1alpha1/tagroute_types.go | 46 +- pkg/core/store/index/instance.go | 18 +- pkg/discovery/nacos2/factory.go | 71 +++ pkg/discovery/nacos2/listerwatcher/mapping.go | 188 ++++++++ .../nacos2/listerwatcher/rpc_instance.go | 278 +++++++++++ .../service_consumer_metadata.go | 251 ++++++++++ .../service_provider_metadata.go | 162 +++++++ pkg/engine/kubernetes/factory.go | 3 +- .../runtime_instance.go} | 41 +- scripts/resourcegen/gen.go | 44 +- 60 files changed, 3446 insertions(+), 603 deletions(-) create mode 100644 nacos rename pkg/{console => common}/constants/constants.go (75%) create mode 100644 pkg/core/discovery/subscriber/rpc_instance.go create mode 100644 pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go create mode 100644 pkg/discovery/nacos2/factory.go create mode 100644 pkg/discovery/nacos2/listerwatcher/mapping.go create mode 100644 pkg/discovery/nacos2/listerwatcher/rpc_instance.go create mode 100644 pkg/discovery/nacos2/listerwatcher/service_consumer_metadata.go create mode 100644 pkg/discovery/nacos2/listerwatcher/service_provider_metadata.go rename pkg/engine/kubernetes/{engine.go => listerwatcher/runtime_instance.go} (85%) diff --git a/api/mesh/v1alpha1/instance.pb.go b/api/mesh/v1alpha1/instance.pb.go index b9e14fa69..d30f9d7a8 100644 --- a/api/mesh/v1alpha1/instance.pb.go +++ b/api/mesh/v1alpha1/instance.pb.go @@ -27,27 +27,28 @@ type Instance struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` - RpcPort int32 `protobuf:"varint,3,opt,name=rpcPort,proto3" json:"rpcPort,omitempty"` - QosPort int32 `protobuf:"varint,4,opt,name=qosPort,proto3" json:"qosPort,omitempty"` - AppName string `protobuf:"bytes,5,opt,name=appName,proto3" json:"appName,omitempty"` - ReleaseVersion string `protobuf:"bytes,6,opt,name=releaseVersion,proto3" json:"releaseVersion,omitempty"` - RegisterTime string `protobuf:"bytes,7,opt,name=registerTime,proto3" json:"registerTime,omitempty"` - UnregisterTime string `protobuf:"bytes,8,opt,name=unregisterTime,proto3" json:"unregisterTime,omitempty"` - Protocol string `protobuf:"bytes,9,opt,name=protocol,proto3" json:"protocol,omitempty"` - Serialization string `protobuf:"bytes,10,opt,name=serialization,proto3" json:"serialization,omitempty"` - Tags map[string]string `protobuf:"bytes,50,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Image string `protobuf:"bytes,51,opt,name=image,proto3" json:"image,omitempty"` - CreateTime string `protobuf:"bytes,52,opt,name=createTime,proto3" json:"createTime,omitempty"` - StartTime string `protobuf:"bytes,53,opt,name=startTime,proto3" json:"startTime,omitempty"` - ReadyTime string `protobuf:"bytes,54,opt,name=readyTime,proto3" json:"readyTime,omitempty"` - DeployState string `protobuf:"bytes,55,opt,name=deployState,proto3" json:"deployState,omitempty"` - WorkloadType string `protobuf:"bytes,56,opt,name=workloadType,proto3" json:"workloadType,omitempty"` - WorkloadName string `protobuf:"bytes,57,opt,name=workloadName,proto3" json:"workloadName,omitempty"` - Node string `protobuf:"bytes,58,opt,name=node,proto3" json:"node,omitempty"` - Probes []*Probe `protobuf:"bytes,59,rep,name=probes,proto3" json:"probes,omitempty"` - Conditions []*Condition `protobuf:"bytes,60,rep,name=conditions,proto3" json:"conditions,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + AppName string `protobuf:"bytes,2,opt,name=appName,proto3" json:"appName,omitempty"` + Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` + RpcPort int64 `protobuf:"varint,4,opt,name=rpcPort,proto3" json:"rpcPort,omitempty"` + QosPort int64 `protobuf:"varint,5,opt,name=qosPort,proto3" json:"qosPort,omitempty"` + ReleaseVersion string `protobuf:"bytes,6,opt,name=releaseVersion,proto3" json:"releaseVersion,omitempty"` + RegisterTime string `protobuf:"bytes,7,opt,name=registerTime,proto3" json:"registerTime,omitempty"` + UnregisterTime string `protobuf:"bytes,8,opt,name=unregisterTime,proto3" json:"unregisterTime,omitempty"` + Protocol string `protobuf:"bytes,9,opt,name=protocol,proto3" json:"protocol,omitempty"` + Serialization string `protobuf:"bytes,10,opt,name=serialization,proto3" json:"serialization,omitempty"` + PreferSerialization string `protobuf:"bytes,11,opt,name=preferSerialization,proto3" json:"preferSerialization,omitempty"` + Tags map[string]string `protobuf:"bytes,50,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Image string `protobuf:"bytes,51,opt,name=image,proto3" json:"image,omitempty"` + CreateTime string `protobuf:"bytes,52,opt,name=createTime,proto3" json:"createTime,omitempty"` + StartTime string `protobuf:"bytes,53,opt,name=startTime,proto3" json:"startTime,omitempty"` + ReadyTime string `protobuf:"bytes,54,opt,name=readyTime,proto3" json:"readyTime,omitempty"` + DeployState string `protobuf:"bytes,55,opt,name=deployState,proto3" json:"deployState,omitempty"` + WorkloadType string `protobuf:"bytes,56,opt,name=workloadType,proto3" json:"workloadType,omitempty"` + WorkloadName string `protobuf:"bytes,57,opt,name=workloadName,proto3" json:"workloadName,omitempty"` + Node string `protobuf:"bytes,58,opt,name=node,proto3" json:"node,omitempty"` + Probes []*Probe `protobuf:"bytes,59,rep,name=probes,proto3" json:"probes,omitempty"` + Conditions []*Condition `protobuf:"bytes,60,rep,name=conditions,proto3" json:"conditions,omitempty"` } func (x *Instance) Reset() { @@ -87,6 +88,13 @@ func (x *Instance) GetName() string { return "" } +func (x *Instance) GetAppName() string { + if x != nil { + return x.AppName + } + return "" +} + func (x *Instance) GetIp() string { if x != nil { return x.Ip @@ -94,27 +102,20 @@ func (x *Instance) GetIp() string { return "" } -func (x *Instance) GetRpcPort() int32 { +func (x *Instance) GetRpcPort() int64 { if x != nil { return x.RpcPort } return 0 } -func (x *Instance) GetQosPort() int32 { +func (x *Instance) GetQosPort() int64 { if x != nil { return x.QosPort } return 0 } -func (x *Instance) GetAppName() string { - if x != nil { - return x.AppName - } - return "" -} - func (x *Instance) GetReleaseVersion() string { if x != nil { return x.ReleaseVersion @@ -150,6 +151,13 @@ func (x *Instance) GetSerialization() string { return "" } +func (x *Instance) GetPreferSerialization() string { + if x != nil { + return x.PreferSerialization + } + return "" +} + func (x *Instance) GetTags() map[string]string { if x != nil { return x.Tags @@ -237,15 +245,15 @@ var file_api_mesh_v1alpha1_instance_proto_rawDesc = []byte{ 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x06, 0x0a, 0x08, 0x49, 0x6e, + 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xef, 0x06, 0x0a, 0x08, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x70, - 0x63, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x70, 0x63, - 0x50, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x71, 0x6f, 0x73, 0x50, 0x6f, 0x72, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x71, 0x6f, 0x73, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x65, 0x6c, 0x65, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, + 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x71, 0x6f, 0x73, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x71, 0x6f, 0x73, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, @@ -256,44 +264,47 @@ var file_api_mesh_v1alpha1_instance_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, - 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x32, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x64, - 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x67, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x18, 0x33, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, - 0x34, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x35, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x36, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x37, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x38, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4e, - 0x61, 0x6d, 0x65, 0x18, 0x39, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, - 0x6f, 0x61, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, - 0x3a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x70, - 0x72, 0x6f, 0x62, 0x65, 0x73, 0x18, 0x3b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x75, - 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x73, 0x12, - 0x3e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x3c, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, - 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x23, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x1d, - 0x0a, 0x08, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x09, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x20, 0x01, 0x4a, 0x04, 0x08, - 0x0b, 0x10, 0x32, 0x4a, 0x04, 0x08, 0x3d, 0x10, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, - 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, - 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x0d, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, + 0x0a, 0x13, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x3b, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x32, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x54, 0x61, + 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x33, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x34, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x18, 0x35, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x36, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x37, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x38, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, + 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x39, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, + 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, + 0x65, 0x18, 0x3a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x32, 0x0a, + 0x06, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x73, 0x18, 0x3b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x62, 0x65, + 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x3c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x23, 0xaa, 0x8c, 0x89, 0xa6, + 0x01, 0x1d, 0x0a, 0x08, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x09, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x20, 0x01, 0x4a, + 0x04, 0x08, 0x0c, 0x10, 0x32, 0x4a, 0x04, 0x08, 0x3d, 0x10, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, + 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/mesh/v1alpha1/instance.proto b/api/mesh/v1alpha1/instance.proto index b475261c2..3e10951b8 100644 --- a/api/mesh/v1alpha1/instance.proto +++ b/api/mesh/v1alpha1/instance.proto @@ -16,17 +16,16 @@ message Instance { string name = 1; - string ip = 2; + string appName = 2; + string ip = 3; + + int64 rpcPort = 4; /* FROM RPCInstance */ - int32 rpcPort = 3; - - int32 qosPort = 4; - - string appName = 5; + int64 qosPort = 5; string releaseVersion = 6; @@ -38,9 +37,11 @@ message Instance { string serialization = 10; + string preferSerialization = 11; + map tags = 50; - reserved 11 to 49; + reserved 12 to 49; /* FROM RuntimeInstance diff --git a/api/mesh/v1alpha1/rpc_instance.pb.go b/api/mesh/v1alpha1/rpc_instance.pb.go index 58672d779..b36b39db3 100644 --- a/api/mesh/v1alpha1/rpc_instance.pb.go +++ b/api/mesh/v1alpha1/rpc_instance.pb.go @@ -27,12 +27,22 @@ type RPCInstance struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` - Port string `protobuf:"bytes,3,opt,name=port,proto3" json:"port,omitempty"` - AppName string `protobuf:"bytes,5,opt,name=appName,proto3" json:"appName,omitempty"` - RegisterTime string `protobuf:"bytes,9,opt,name=registerTime,proto3" json:"registerTime,omitempty"` - UnregisterTime string `protobuf:"bytes,10,opt,name=unregisterTime,proto3" json:"unregisterTime,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` + Port int64 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` + AppName string `protobuf:"bytes,5,opt,name=appName,proto3" json:"appName,omitempty"` + RegisterTime string `protobuf:"bytes,6,opt,name=registerTime,proto3" json:"registerTime,omitempty"` + // TODO, we need to sort out the status of an instance + UnregisterTime string `protobuf:"bytes,7,opt,name=unregisterTime,proto3" json:"unregisterTime,omitempty"` + Revision string `protobuf:"bytes,8,opt,name=revision,proto3" json:"revision,omitempty"` + MetadataStorageType string `protobuf:"bytes,9,opt,name=metadataStorageType,proto3" json:"metadataStorageType,omitempty"` + ReleaseVersion string `protobuf:"bytes,10,opt,name=releaseVersion,proto3" json:"releaseVersion,omitempty"` + Protocol string `protobuf:"bytes,11,opt,name=protocol,proto3" json:"protocol,omitempty"` + Serialization string `protobuf:"bytes,12,opt,name=serialization,proto3" json:"serialization,omitempty"` + PreferSerialization string `protobuf:"bytes,13,opt,name=preferSerialization,proto3" json:"preferSerialization,omitempty"` + Tags map[string]string `protobuf:"bytes,51,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Endpoints []*Endpoint `protobuf:"bytes,52,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + Metadata map[string]string `protobuf:"bytes,53,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *RPCInstance) Reset() { @@ -79,11 +89,11 @@ func (x *RPCInstance) GetIp() string { return "" } -func (x *RPCInstance) GetPort() string { +func (x *RPCInstance) GetPort() int64 { if x != nil { return x.Port } - return "" + return 0 } func (x *RPCInstance) GetAppName() string { @@ -107,6 +117,122 @@ func (x *RPCInstance) GetUnregisterTime() string { return "" } +func (x *RPCInstance) GetRevision() string { + if x != nil { + return x.Revision + } + return "" +} + +func (x *RPCInstance) GetMetadataStorageType() string { + if x != nil { + return x.MetadataStorageType + } + return "" +} + +func (x *RPCInstance) GetReleaseVersion() string { + if x != nil { + return x.ReleaseVersion + } + return "" +} + +func (x *RPCInstance) GetProtocol() string { + if x != nil { + return x.Protocol + } + return "" +} + +func (x *RPCInstance) GetSerialization() string { + if x != nil { + return x.Serialization + } + return "" +} + +func (x *RPCInstance) GetPreferSerialization() string { + if x != nil { + return x.PreferSerialization + } + return "" +} + +func (x *RPCInstance) GetTags() map[string]string { + if x != nil { + return x.Tags + } + return nil +} + +func (x *RPCInstance) GetEndpoints() []*Endpoint { + if x != nil { + return x.Endpoints + } + return nil +} + +func (x *RPCInstance) GetMetadata() map[string]string { + if x != nil { + return x.Metadata + } + return nil +} + +type Endpoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Port int64 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` + Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"` +} + +func (x *Endpoint) Reset() { + *x = Endpoint{} + mi := &file_api_mesh_v1alpha1_rpc_instance_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Endpoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Endpoint) ProtoMessage() {} + +func (x *Endpoint) ProtoReflect() protoreflect.Message { + mi := &file_api_mesh_v1alpha1_rpc_instance_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Endpoint.ProtoReflect.Descriptor instead. +func (*Endpoint) Descriptor() ([]byte, []int) { + return file_api_mesh_v1alpha1_rpc_instance_proto_rawDescGZIP(), []int{1} +} + +func (x *Endpoint) GetPort() int64 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *Endpoint) GetProtocol() string { + if x != nil { + return x.Protocol + } + return "" +} + var File_api_mesh_v1alpha1_rpc_instance_proto protoreflect.FileDescriptor var file_api_mesh_v1alpha1_rpc_instance_proto_rawDesc = []byte{ @@ -115,24 +241,63 @@ var file_api_mesh_v1alpha1_rpc_instance_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x16, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x01, 0x0a, 0x0b, 0x52, 0x50, 0x43, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x06, 0x0a, 0x0b, 0x52, 0x50, 0x43, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x67, + 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x75, 0x6e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x69, 0x6d, - 0x65, 0x3a, 0x29, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x23, 0x0a, 0x0b, 0x52, 0x50, 0x43, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x0c, 0x52, 0x50, 0x43, 0x49, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x20, 0x01, 0x42, 0x31, 0x5a, 0x2f, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, - 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, + 0x13, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x26, 0x0a, 0x0e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x13, 0x70, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x04, 0x74, + 0x61, 0x67, 0x73, 0x18, 0x33, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x64, 0x75, 0x62, 0x62, + 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x52, 0x50, 0x43, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x67, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x3b, 0x0a, 0x09, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x34, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x4a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x35, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x64, 0x75, 0x62, + 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x52, 0x50, 0x43, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, + 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x29, 0xaa, 0x8c, 0x89, 0xa6, + 0x01, 0x23, 0x0a, 0x0b, 0x52, 0x50, 0x43, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x0c, 0x52, 0x50, 0x43, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x04, 0x6d, + 0x65, 0x73, 0x68, 0x20, 0x01, 0x4a, 0x04, 0x08, 0x0f, 0x10, 0x33, 0x22, 0x3a, 0x0a, 0x08, 0x45, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, + 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, + 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -147,16 +312,22 @@ func file_api_mesh_v1alpha1_rpc_instance_proto_rawDescGZIP() []byte { return file_api_mesh_v1alpha1_rpc_instance_proto_rawDescData } -var file_api_mesh_v1alpha1_rpc_instance_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_mesh_v1alpha1_rpc_instance_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_api_mesh_v1alpha1_rpc_instance_proto_goTypes = []any{ (*RPCInstance)(nil), // 0: dubbo.mesh.v1alpha1.RPCInstance + (*Endpoint)(nil), // 1: dubbo.mesh.v1alpha1.Endpoint + nil, // 2: dubbo.mesh.v1alpha1.RPCInstance.TagsEntry + nil, // 3: dubbo.mesh.v1alpha1.RPCInstance.MetadataEntry } var file_api_mesh_v1alpha1_rpc_instance_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 2, // 0: dubbo.mesh.v1alpha1.RPCInstance.tags:type_name -> dubbo.mesh.v1alpha1.RPCInstance.TagsEntry + 1, // 1: dubbo.mesh.v1alpha1.RPCInstance.endpoints:type_name -> dubbo.mesh.v1alpha1.Endpoint + 3, // 2: dubbo.mesh.v1alpha1.RPCInstance.metadata:type_name -> dubbo.mesh.v1alpha1.RPCInstance.MetadataEntry + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_api_mesh_v1alpha1_rpc_instance_proto_init() } @@ -170,7 +341,7 @@ func file_api_mesh_v1alpha1_rpc_instance_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_mesh_v1alpha1_rpc_instance_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/api/mesh/v1alpha1/rpc_instance.proto b/api/mesh/v1alpha1/rpc_instance.proto index b3fe877df..151f6153f 100644 --- a/api/mesh/v1alpha1/rpc_instance.proto +++ b/api/mesh/v1alpha1/rpc_instance.proto @@ -17,12 +17,38 @@ message RPCInstance { string ip = 2; - string port = 3; + int64 port = 3; string appName = 5; - string registerTime = 9; + string registerTime = 6; - string unregisterTime = 10; + // TODO, we need to sort out the status of an instance + string unregisterTime = 7; + string revision = 8; + + string metadataStorageType = 9; + + string releaseVersion = 10; + + string protocol = 11; + + string serialization = 12; + + string preferSerialization = 13; + + map tags = 51; + + repeated Endpoint endpoints = 52; + + map metadata = 53; + + reserved 15 to 50; +} + +message Endpoint{ + int64 port = 1; + + string protocol= 2; } \ No newline at end of file diff --git a/api/mesh/v1alpha1/runtime_instance.pb.go b/api/mesh/v1alpha1/runtime_instance.pb.go index 8772e5a51..9f6443c87 100644 --- a/api/mesh/v1alpha1/runtime_instance.pb.go +++ b/api/mesh/v1alpha1/runtime_instance.pb.go @@ -29,17 +29,24 @@ type RuntimeInstance struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` - Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` - AppName string `protobuf:"bytes,4,opt,name=appName,proto3" json:"appName,omitempty"` - CreateTime string `protobuf:"bytes,5,opt,name=createTime,proto3" json:"createTime,omitempty"` - StartTime string `protobuf:"bytes,6,opt,name=startTime,proto3" json:"startTime,omitempty"` - ReadyTime string `protobuf:"bytes,7,opt,name=readyTime,proto3" json:"readyTime,omitempty"` - Phase string `protobuf:"bytes,8,opt,name=phase,proto3" json:"phase,omitempty"` - WorkloadName string `protobuf:"bytes,9,opt,name=workloadName,proto3" json:"workloadName,omitempty"` - WorkloadType string `protobuf:"bytes,10,opt,name=workloadType,proto3" json:"workloadType,omitempty"` - Node string `protobuf:"bytes,11,opt,name=node,proto3" json:"node,omitempty"` - Probes []*Probe `protobuf:"bytes,12,rep,name=probes,proto3" json:"probes,omitempty"` - Conditions []*Condition `protobuf:"bytes,13,rep,name=conditions,proto3" json:"conditions,omitempty"` + RpcPort int64 `protobuf:"varint,3,opt,name=rpcPort,proto3" json:"rpcPort,omitempty"` + Image string `protobuf:"bytes,4,opt,name=image,proto3" json:"image,omitempty"` + AppName string `protobuf:"bytes,5,opt,name=appName,proto3" json:"appName,omitempty"` + Mesh string `protobuf:"bytes,6,opt,name=mesh,proto3" json:"mesh,omitempty"` + CreateTime string `protobuf:"bytes,7,opt,name=createTime,proto3" json:"createTime,omitempty"` + StartTime string `protobuf:"bytes,8,opt,name=startTime,proto3" json:"startTime,omitempty"` + ReadyTime string `protobuf:"bytes,9,opt,name=readyTime,proto3" json:"readyTime,omitempty"` + Phase string `protobuf:"bytes,10,opt,name=phase,proto3" json:"phase,omitempty"` + WorkloadName string `protobuf:"bytes,11,opt,name=workloadName,proto3" json:"workloadName,omitempty"` + WorkloadType string `protobuf:"bytes,12,opt,name=workloadType,proto3" json:"workloadType,omitempty"` + Node string `protobuf:"bytes,13,opt,name=node,proto3" json:"node,omitempty"` + Probes []*Probe `protobuf:"bytes,14,rep,name=probes,proto3" json:"probes,omitempty"` + Conditions []*Condition `protobuf:"bytes,15,rep,name=conditions,proto3" json:"conditions,omitempty"` + // start from 50 for extra fields which is added by components in admin + // sourceEngine is the engine name of runtime instance running on + SourceEngine string `protobuf:"bytes,51,opt,name=sourceEngine,proto3" json:"sourceEngine,omitempty"` + // sourceEngineType is the engine type of runtime instance running on + SourceEngineType string `protobuf:"bytes,52,opt,name=sourceEngineType,proto3" json:"sourceEngineType,omitempty"` } func (x *RuntimeInstance) Reset() { @@ -86,6 +93,13 @@ func (x *RuntimeInstance) GetIp() string { return "" } +func (x *RuntimeInstance) GetRpcPort() int64 { + if x != nil { + return x.RpcPort + } + return 0 +} + func (x *RuntimeInstance) GetImage() string { if x != nil { return x.Image @@ -100,6 +114,13 @@ func (x *RuntimeInstance) GetAppName() string { return "" } +func (x *RuntimeInstance) GetMesh() string { + if x != nil { + return x.Mesh + } + return "" +} + func (x *RuntimeInstance) GetCreateTime() string { if x != nil { return x.CreateTime @@ -163,6 +184,20 @@ func (x *RuntimeInstance) GetConditions() []*Condition { return nil } +func (x *RuntimeInstance) GetSourceEngine() string { + if x != nil { + return x.SourceEngine + } + return "" +} + +func (x *RuntimeInstance) GetSourceEngineType() string { + if x != nil { + return x.SourceEngineType + } + return "" +} + type Probe struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -302,53 +337,61 @@ var file_api_mesh_v1alpha1_runtime_instance_proto_rawDesc = []byte{ 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x16, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x03, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x04, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, - 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, - 0x68, 0x61, 0x73, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x61, 0x73, - 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x61, 0x6d, - 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, - 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, - 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, - 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, - 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x32, 0x0a, - 0x06, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x62, 0x65, - 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, - 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x3a, 0x31, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x2b, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x52, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x04, 0x6d, 0x65, - 0x73, 0x68, 0x20, 0x01, 0x22, 0x2f, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6c, 0x61, 0x73, - 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x18, 0x0a, 0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x73, + 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, + 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x61, + 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x12, + 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, + 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x70, + 0x72, 0x6f, 0x62, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x75, + 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x73, 0x12, + 0x3e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x22, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, + 0x33, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x34, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3a, + 0x31, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x2b, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, + 0x20, 0x01, 0x4a, 0x04, 0x08, 0x10, 0x10, 0x33, 0x22, 0x2f, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x43, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, + 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/mesh/v1alpha1/runtime_instance.proto b/api/mesh/v1alpha1/runtime_instance.proto index 65abb130c..9a59ea2e2 100644 --- a/api/mesh/v1alpha1/runtime_instance.proto +++ b/api/mesh/v1alpha1/runtime_instance.proto @@ -17,27 +17,40 @@ message RuntimeInstance { string ip = 2; - string image = 3; + int64 rpcPort = 3; - string appName = 4; + string image = 4; - string createTime = 5; + string appName = 5; - string startTime = 6; + string createTime = 6; - string readyTime = 7; + string startTime = 7; - string phase = 8; + string readyTime = 8; - string workloadName = 9; + string phase = 9; - string workloadType = 10; + string workloadName = 10; - string node = 11; + string workloadType = 11; - repeated Probe probes = 12; + string node = 12; + + repeated Probe probes = 13; + + repeated Condition conditions = 14; + + // reserved for future use + reserved 15 to 50; + + // start from 50 for extra fields which is added by components in admin + // sourceEngine is the engine name of runtime instance running on + string sourceEngine = 51; + + // sourceEngineType is the engine type of runtime instance running on + string sourceEngineType = 52; - repeated Condition conditions = 13; } message Probe { diff --git a/api/mesh/v1alpha1/service_consumer_metadata.pb.go b/api/mesh/v1alpha1/service_consumer_metadata.pb.go index 8689a9932..c25f3a64d 100644 --- a/api/mesh/v1alpha1/service_consumer_metadata.pb.go +++ b/api/mesh/v1alpha1/service_consumer_metadata.pb.go @@ -26,10 +26,11 @@ type ServiceConsumerMetadata struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"` - ConsumerAppName string `protobuf:"bytes,2,opt,name=consumerAppName,proto3" json:"consumerAppName,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - Group string `protobuf:"bytes,4,opt,name=group,proto3" json:"group,omitempty"` // TODO add more fields + ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"` + ConsumerAppName string `protobuf:"bytes,2,opt,name=consumerAppName,proto3" json:"consumerAppName,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Group string `protobuf:"bytes,4,opt,name=group,proto3" json:"group,omitempty"` + Metadata map[string]string `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *ServiceConsumerMetadata) Reset() { @@ -90,6 +91,13 @@ func (x *ServiceConsumerMetadata) GetGroup() string { return "" } +func (x *ServiceConsumerMetadata) GetMetadata() map[string]string { + if x != nil { + return x.Metadata + } + return nil +} + var File_api_mesh_v1alpha1_service_consumer_metadata_proto protoreflect.FileDescriptor var file_api_mesh_v1alpha1_service_consumer_metadata_proto_rawDesc = []byte{ @@ -99,7 +107,7 @@ var file_api_mesh_v1alpha1_service_consumer_metadata_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x16, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xd6, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, + 0x22, 0xeb, 0x02, 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, @@ -108,15 +116,24 @@ var file_api_mesh_v1alpha1_service_consumer_metadata_proto_rawDesc = []byte{ 0x72, 0x41, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x3a, 0x3f, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x39, - 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, - 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, - 0x74, 0x61, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, - 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, - 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x56, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x64, 0x75, 0x62, + 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x3f, 0xaa, + 0x8c, 0x89, 0xa6, 0x01, 0x39, 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x4d, + 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x42, 0x31, + 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, + 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -131,16 +148,18 @@ func file_api_mesh_v1alpha1_service_consumer_metadata_proto_rawDescGZIP() []byte return file_api_mesh_v1alpha1_service_consumer_metadata_proto_rawDescData } -var file_api_mesh_v1alpha1_service_consumer_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_mesh_v1alpha1_service_consumer_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_api_mesh_v1alpha1_service_consumer_metadata_proto_goTypes = []any{ (*ServiceConsumerMetadata)(nil), // 0: dubbo.mesh.v1alpha1.ServiceConsumerMetadata + nil, // 1: dubbo.mesh.v1alpha1.ServiceConsumerMetadata.MetadataEntry } var file_api_mesh_v1alpha1_service_consumer_metadata_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 1, // 0: dubbo.mesh.v1alpha1.ServiceConsumerMetadata.metadata:type_name -> dubbo.mesh.v1alpha1.ServiceConsumerMetadata.MetadataEntry + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_api_mesh_v1alpha1_service_consumer_metadata_proto_init() } @@ -154,7 +173,7 @@ func file_api_mesh_v1alpha1_service_consumer_metadata_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_mesh_v1alpha1_service_consumer_metadata_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/api/mesh/v1alpha1/service_consumer_metadata.proto b/api/mesh/v1alpha1/service_consumer_metadata.proto index 95728d042..f2a185e37 100644 --- a/api/mesh/v1alpha1/service_consumer_metadata.proto +++ b/api/mesh/v1alpha1/service_consumer_metadata.proto @@ -19,6 +19,7 @@ message ServiceConsumerMetadata { string version = 3; string group = 4; - // TODO add more fields + + map metadata = 5; } diff --git a/api/mesh/v1alpha1/service_provider_metadata.pb.go b/api/mesh/v1alpha1/service_provider_metadata.pb.go index 73a3bd3cb..8900a8b6b 100644 --- a/api/mesh/v1alpha1/service_provider_metadata.pb.go +++ b/api/mesh/v1alpha1/service_provider_metadata.pb.go @@ -26,10 +26,14 @@ type ServiceProviderMetadata struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"` - ProviderAppName string `protobuf:"bytes,2,opt,name=providerAppName,proto3" json:"providerAppName,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - Group string `protobuf:"bytes,4,opt,name=group,proto3" json:"group,omitempty"` // TODO add more fields + ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"` + ProviderAppName string `protobuf:"bytes,2,opt,name=providerAppName,proto3" json:"providerAppName,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Group string `protobuf:"bytes,4,opt,name=group,proto3" json:"group,omitempty"` + CanonicalName string `protobuf:"bytes,5,opt,name=canonicalName,proto3" json:"canonicalName,omitempty"` + Methods []*Method `protobuf:"bytes,6,rep,name=methods,proto3" json:"methods,omitempty"` + Parameters map[string]string `protobuf:"bytes,7,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Types []*Type `protobuf:"bytes,8,rep,name=types,proto3" json:"types,omitempty"` } func (x *ServiceProviderMetadata) Reset() { @@ -90,6 +94,233 @@ func (x *ServiceProviderMetadata) GetGroup() string { return "" } +func (x *ServiceProviderMetadata) GetCanonicalName() string { + if x != nil { + return x.CanonicalName + } + return "" +} + +func (x *ServiceProviderMetadata) GetMethods() []*Method { + if x != nil { + return x.Methods + } + return nil +} + +func (x *ServiceProviderMetadata) GetParameters() map[string]string { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *ServiceProviderMetadata) GetTypes() []*Type { + if x != nil { + return x.Types + } + return nil +} + +type Method struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Annotations []string `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + ParameterTypes []string `protobuf:"bytes,3,rep,name=parameterTypes,proto3" json:"parameterTypes,omitempty"` + Parameters []*Parameter `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty"` + ReturnType string `protobuf:"bytes,5,opt,name=returnType,proto3" json:"returnType,omitempty"` +} + +func (x *Method) Reset() { + *x = Method{} + mi := &file_api_mesh_v1alpha1_service_provider_metadata_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Method) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Method) ProtoMessage() {} + +func (x *Method) ProtoReflect() protoreflect.Message { + mi := &file_api_mesh_v1alpha1_service_provider_metadata_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Method.ProtoReflect.Descriptor instead. +func (*Method) Descriptor() ([]byte, []int) { + return file_api_mesh_v1alpha1_service_provider_metadata_proto_rawDescGZIP(), []int{1} +} + +func (x *Method) GetAnnotations() []string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *Method) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Method) GetParameterTypes() []string { + if x != nil { + return x.ParameterTypes + } + return nil +} + +func (x *Method) GetParameters() []*Parameter { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *Method) GetReturnType() string { + if x != nil { + return x.ReturnType + } + return "" +} + +type Parameter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` +} + +func (x *Parameter) Reset() { + *x = Parameter{} + mi := &file_api_mesh_v1alpha1_service_provider_metadata_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Parameter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Parameter) ProtoMessage() {} + +func (x *Parameter) ProtoReflect() protoreflect.Message { + mi := &file_api_mesh_v1alpha1_service_provider_metadata_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Parameter.ProtoReflect.Descriptor instead. +func (*Parameter) Descriptor() ([]byte, []int) { + return file_api_mesh_v1alpha1_service_provider_metadata_proto_rawDescGZIP(), []int{2} +} + +func (x *Parameter) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Parameter) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +type Type struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enums []string `protobuf:"bytes,1,rep,name=enums,proto3" json:"enums,omitempty"` + Items []string `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` + Properties map[string]string `protobuf:"bytes,3,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` +} + +func (x *Type) Reset() { + *x = Type{} + mi := &file_api_mesh_v1alpha1_service_provider_metadata_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Type) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Type) ProtoMessage() {} + +func (x *Type) ProtoReflect() protoreflect.Message { + mi := &file_api_mesh_v1alpha1_service_provider_metadata_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Type.ProtoReflect.Descriptor instead. +func (*Type) Descriptor() ([]byte, []int) { + return file_api_mesh_v1alpha1_service_provider_metadata_proto_rawDescGZIP(), []int{3} +} + +func (x *Type) GetEnums() []string { + if x != nil { + return x.Enums + } + return nil +} + +func (x *Type) GetItems() []string { + if x != nil { + return x.Items + } + return nil +} + +func (x *Type) GetProperties() map[string]string { + if x != nil { + return x.Properties + } + return nil +} + +func (x *Type) GetType() string { + if x != nil { + return x.Type + } + return "" +} + var File_api_mesh_v1alpha1_service_provider_metadata_proto protoreflect.FileDescriptor var file_api_mesh_v1alpha1_service_provider_metadata_proto_rawDesc = []byte{ @@ -99,7 +330,7 @@ var file_api_mesh_v1alpha1_service_provider_metadata_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x16, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xd6, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x76, + 0x22, 0x81, 0x04, 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, @@ -108,15 +339,62 @@ var file_api_mesh_v1alpha1_service_provider_metadata_proto_rawDesc = []byte{ 0x72, 0x41, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x3a, 0x3f, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x39, - 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, - 0x74, 0x61, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, - 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, - 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x6f, + 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x35, + 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x07, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x5c, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x64, 0x75, 0x62, 0x62, + 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x3a, 0x3f, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x39, 0x0a, 0x17, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x73, 0x1a, 0x04, + 0x6d, 0x65, 0x73, 0x68, 0x22, 0xc6, 0x01, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, + 0x20, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x3e, 0x0a, + 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x0a, + 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x33, 0x0a, + 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6e, 0x75, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x75, 0x6d, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x49, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x64, 0x75, + 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, + 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, + 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -131,16 +409,26 @@ func file_api_mesh_v1alpha1_service_provider_metadata_proto_rawDescGZIP() []byte return file_api_mesh_v1alpha1_service_provider_metadata_proto_rawDescData } -var file_api_mesh_v1alpha1_service_provider_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_mesh_v1alpha1_service_provider_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_api_mesh_v1alpha1_service_provider_metadata_proto_goTypes = []any{ (*ServiceProviderMetadata)(nil), // 0: dubbo.mesh.v1alpha1.ServiceProviderMetadata + (*Method)(nil), // 1: dubbo.mesh.v1alpha1.Method + (*Parameter)(nil), // 2: dubbo.mesh.v1alpha1.Parameter + (*Type)(nil), // 3: dubbo.mesh.v1alpha1.Type + nil, // 4: dubbo.mesh.v1alpha1.ServiceProviderMetadata.ParametersEntry + nil, // 5: dubbo.mesh.v1alpha1.Type.PropertiesEntry } var file_api_mesh_v1alpha1_service_provider_metadata_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 1, // 0: dubbo.mesh.v1alpha1.ServiceProviderMetadata.methods:type_name -> dubbo.mesh.v1alpha1.Method + 4, // 1: dubbo.mesh.v1alpha1.ServiceProviderMetadata.parameters:type_name -> dubbo.mesh.v1alpha1.ServiceProviderMetadata.ParametersEntry + 3, // 2: dubbo.mesh.v1alpha1.ServiceProviderMetadata.types:type_name -> dubbo.mesh.v1alpha1.Type + 2, // 3: dubbo.mesh.v1alpha1.Method.parameters:type_name -> dubbo.mesh.v1alpha1.Parameter + 5, // 4: dubbo.mesh.v1alpha1.Type.properties:type_name -> dubbo.mesh.v1alpha1.Type.PropertiesEntry + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_api_mesh_v1alpha1_service_provider_metadata_proto_init() } @@ -154,7 +442,7 @@ func file_api_mesh_v1alpha1_service_provider_metadata_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_mesh_v1alpha1_service_provider_metadata_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/api/mesh/v1alpha1/service_provider_metadata.proto b/api/mesh/v1alpha1/service_provider_metadata.proto index abbf4a267..b167269b3 100644 --- a/api/mesh/v1alpha1/service_provider_metadata.proto +++ b/api/mesh/v1alpha1/service_provider_metadata.proto @@ -19,5 +19,40 @@ message ServiceProviderMetadata { string version = 3; string group = 4; - // TODO add more fields -} \ No newline at end of file + + string canonicalName = 5; + + repeated Method methods = 6; + + map parameters = 7; + + repeated Type types = 8; +} + +message Method { + repeated string annotations = 1; + + string name = 2; + + repeated string parameterTypes = 3; + + repeated Parameter parameters = 4; + + string returnType = 5; +} + +message Parameter { + string name = 1; + + string type = 2; +} + +message Type { + repeated string enums = 1; + + repeated string items = 2; + + map properties = 3; + + string type = 4; +} diff --git a/app/dubbo-admin/cmd/run.go b/app/dubbo-admin/cmd/run.go index 67e14f4c5..ac5c17204 100644 --- a/app/dubbo-admin/cmd/run.go +++ b/app/dubbo-admin/cmd/run.go @@ -49,18 +49,18 @@ func newRunCmdWithOpts(opts dubbocmd.RunCmdOpts) *cobra.Command { cfg := app.DefaultAdminConfig() err := config.Load(args.configPath, &cfg) if err != nil { - logger.Errorf("could not load the configuration, err: %s", err.Error()) + logger.Errorf("could not load the configuration, cause: %s", err.Error()) return err } cfgForDisplay, err := config.ConfigForDisplay(&cfg) if err != nil { - logger.Errorf("unable to prepare config for display, err: %s", err.Error()) + logger.Errorf("unable to prepare config for display, cause: %s", err.Error()) return err } cfgBytes, err := config.ToJson(cfgForDisplay) if err != nil { - logger.Errorf("unable to convert config to json, err: %s", err.Error()) + logger.Errorf("unable to convert config to json, cause: %s", err.Error()) return err } logger.Infof("Current config %s", cfgBytes) @@ -70,14 +70,14 @@ func newRunCmdWithOpts(opts dubbocmd.RunCmdOpts) *cobra.Command { gracefulCtx, ctx := opts.SetupSignalHandler() rt, err := bootstrap.Bootstrap(gracefulCtx, cfg) if err != nil { - logger.Errorf("unable to bootstrap, err: %s", err.Error()) + logger.Errorf("unable to bootstrap, cause: %s", err.Error()) return err } // 3. start components logger.Infof("starting Admin......, version: %s", dubboversion.Build.Version) if err := rt.Start(gracefulCtx.Done()); err != nil { - logger.Errorf("problem running Admin, err: %s", err.Error()) + logger.Errorf("problem running Admin, cause: %s", err.Error()) return err } logger.Info("stop signal received. Waiting 3 seconds for components to stop gracefully...") diff --git a/app/dubbo-admin/dubbo-admin.yaml b/app/dubbo-admin/dubbo-admin.yaml index 178957721..2455284dc 100644 --- a/app/dubbo-admin/dubbo-admin.yaml +++ b/app/dubbo-admin/dubbo-admin.yaml @@ -39,13 +39,19 @@ console: store: type: memory discovery: -# - type: nacos -# name: nacos-44.33 -# address: -# registry: nacos://47.76.94.134:8848?username=nacos&password=nacos -# configCenter: nacos://47.76.94.134:8848?username=nacos&password=nacos -# metadataReport: nacos://47.76.94.134:8848?username=nacos&password=nacos -# + - type: nacos2 + name: localhost-nacos + address: + registry: nacos://127.0.0.1:28848?username=nacos&password=nacos + configCenter: nacos://127.0.0.1:28848?username=nacos&password=nacos + metadataReport: nacos://127.0.0.1:28848?username=nacos&password=nacos + properties: + # [Nacos2] Adjust the interval(time unit is `s`) to adjust the frequency of list-all configs in nacos. + # Default period is 30s + configWatchPeriod: 20 + # [Nacos2] Adjust the interval(time unit is `s`) to adjust the frequency of list-all services in nacos. + # Default period is 30s + serviceWatchPeriod: 20 # - type: etcd # name: etcd-44.33 # address: @@ -64,7 +70,7 @@ engine: kubeConfigPath: /root/.kube/config # [Kubernetes] Watch pods with specified labels, if not set, will watch all pods # podWatchSelector: org.apache.dubbo/dubbo-apps=true - # [Kubernetes] Identify which Dubbo app the pod belongs to, if not set, [type = ByIP] will be used + # [Kubernetes] Identify which Dubbo app the pod belongs to, if not set, pod will not be seen as a dubbo instance at first # 1. ByLabels: Use the label value corresponding to the labelKey as the dubbo app name # e.g. # type: ByLabel @@ -73,13 +79,27 @@ engine: # e.g. # type: ByAnnotation # annotationKey: org.apache.dubbo/dubbo-app-name - # 3. ByIP(default): Use pod's IP to find if there is a same ip of an instance and use the instance's app name as the identifier, - # if there is no such association, the pod will not be seen as a pod of dubbo application. - # e.g. - # type: ByIP # dubboAppIdentifier: # type: ByLabel # labelKey: org.apache.dubbo/dubbo-app-name + # [Kubernetes] Identify the rpc port of a dubbo application, if not set, pod will not be seen as a dubbo instance at first + # 1. ByLabels: Use the label value corresponding to the labelKey as the dubbo rpc port + # e.g. + # type: ByLabel + # labelKey: org.apache.dubbo/dubbo-rpc-port + # 2. ByAnnotation: Use the annotation value corresponding to the annotationKey as the dubbo rpc port + # e.g. + # type: ByAnnotation + # annotationKey: org.apache.dubbo/dubbo-rpc-port + # [Kubernetes] Identify the registry(discovery) which the dubbo instance belongs to, if not set, pod will not be seen as a dubbo instance at first + # 1. ByLabels: Use the label value corresponding to the labelKey as the dubbo registry name + # e.g. + # type: ByLabel + # labelKey: org.apache.dubbo/registry + # 2. ByAnnotation: Use the annotation value corresponding to the annotationKey as the dubbo registry name + # e.g. + # type: ByAnnotation + # annotationKey: org.apache.dubbo/registry # [Kubernetes] Strategy of choosing the main container, if not set, [type = ByIndex] and [index = 0] will be used # 1. ByLast: choose the last container as the main container # e.g. diff --git a/go.mod b/go.mod index e10d555bc..327fdfa46 100644 --- a/go.mod +++ b/go.mod @@ -15,9 +15,12 @@ module github.com/apache/dubbo-admin -go 1.23.0 +go 1.24.0 + +toolchain go1.24.11 require ( + dubbo.apache.org/dubbo-go/v3 v3.3.0 github.com/Masterminds/semver/v3 v3.2.1 github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 github.com/dubbogo/gost v1.14.0 @@ -28,6 +31,7 @@ require ( github.com/fullstorydev/grpcurl v1.9.1 github.com/gin-contrib/sessions v1.0.4 github.com/gin-gonic/gin v1.10.1 + github.com/go-co-op/gocron v1.9.0 github.com/go-logr/logr v1.4.2 github.com/go-logr/zapr v1.3.0 github.com/goburrow/cache v0.1.4 @@ -39,6 +43,7 @@ require ( github.com/jhump/protoreflect v1.16.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/mitchellh/mapstructure v1.5.0 + github.com/nacos-group/nacos-sdk-go/v2 v2.3.5 github.com/onsi/ginkgo/v2 v2.22.1 github.com/onsi/gomega v1.36.2 github.com/pkg/errors v0.9.1 @@ -49,8 +54,8 @@ require ( go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 - golang.org/x/sys v0.32.0 - golang.org/x/text v0.24.0 + golang.org/x/sys v0.38.0 + golang.org/x/text v0.31.0 google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 gopkg.in/natefinch/lumberjack.v2 v2.2.1 @@ -66,8 +71,61 @@ require ( sigs.k8s.io/yaml v1.4.0 ) +require ( + github.com/RoaringBitmap/roaring v1.2.3 // indirect + github.com/Workiva/go-datastructures v1.0.52 // indirect + github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.6 // indirect + github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect + github.com/alibabacloud-go/darabonba-array v0.1.0 // indirect + github.com/alibabacloud-go/darabonba-encode-util v0.0.2 // indirect + github.com/alibabacloud-go/darabonba-map v0.0.2 // indirect + github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10 // indirect + github.com/alibabacloud-go/darabonba-signature-util v0.0.7 // indirect + github.com/alibabacloud-go/darabonba-string v1.0.2 // indirect + github.com/alibabacloud-go/debug v1.0.1 // indirect + github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect + github.com/alibabacloud-go/kms-20160120/v3 v3.2.3 // indirect + github.com/alibabacloud-go/openapi-util v0.1.0 // indirect + github.com/alibabacloud-go/tea v1.2.2 // indirect + github.com/alibabacloud-go/tea-utils v1.4.4 // indirect + github.com/alibabacloud-go/tea-utils/v2 v2.0.7 // indirect + github.com/alibabacloud-go/tea-xml v1.1.3 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.61.1800 // indirect + github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.5.1 // indirect + github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.8 // indirect + github.com/aliyun/aliyun-secretsmanager-client-go v1.1.5 // indirect + github.com/aliyun/credentials-go v1.4.3 // indirect + github.com/apache/dubbo-go-hessian2 v1.12.5 // indirect + github.com/bits-and-blooms/bitset v1.2.0 // indirect + github.com/buger/jsonparser v1.1.1 // indirect + github.com/clbanning/mxj/v2 v2.5.5 // indirect + github.com/creasty/defaults v1.5.2 // indirect + github.com/deckarep/golang-set v1.7.1 // indirect + github.com/dubbogo/grpc-go v1.42.10 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/influxdata/tdigest v0.0.1 // indirect + github.com/jinzhu/copier v0.3.5 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/mschoch/smat v0.2.0 // indirect + github.com/natefinch/lumberjack v2.0.0+incompatible // indirect + github.com/orcaman/concurrent-map v0.0.0-20210501183033-44dafcb38ecc // indirect + github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/tjfoc/gmsm v1.4.1 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.10.0 // indirect + go.opentelemetry.io/otel v1.35.0 // indirect + go.opentelemetry.io/otel/metric v1.35.0 // indirect + go.opentelemetry.io/otel/sdk v1.35.0 // indirect + go.opentelemetry.io/otel/trace v1.35.0 // indirect + go.uber.org/atomic v1.10.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect +) + require ( cel.dev/expr v0.23.0 // indirect + cloud.google.com/go/compute/metadata v0.6.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bufbuild/protocompile v0.10.0 // indirect @@ -81,7 +139,8 @@ require ( github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect - github.com/gin-contrib/sse v1.0.0 // indirect + github.com/gin-contrib/sse v1.1.0 // indirect + github.com/gin-contrib/zap v1.1.6 // indirect github.com/go-jose/go-jose/v4 v4.0.5 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect @@ -116,7 +175,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -129,13 +188,13 @@ require ( github.com/x448/float16 v0.8.4 // indirect github.com/zeebo/errs v1.4.0 // indirect golang.org/x/arch v0.16.0 // indirect - golang.org/x/crypto v0.37.0 // indirect - golang.org/x/net v0.38.0 // indirect + golang.org/x/crypto v0.45.0 // indirect + golang.org/x/net v0.47.0 // indirect golang.org/x/oauth2 v0.28.0 // indirect - golang.org/x/sync v0.13.0 // indirect - golang.org/x/term v0.31.0 // indirect + golang.org/x/sync v0.18.0 // indirect + golang.org/x/term v0.37.0 // indirect golang.org/x/time v0.7.0 // indirect - golang.org/x/tools v0.28.0 // indirect + golang.org/x/tools v0.38.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect @@ -149,6 +208,7 @@ require ( ) replace ( + cloud.google.com/go/compute/metadata => cloud.google.com/go/compute/metadata v0.6.0 github.com/docker/cli => github.com/docker/cli v23.0.1+incompatible github.com/docker/distribution => github.com/docker/distribution v2.8.2+incompatible github.com/docker/docker => github.com/docker/docker v23.0.1+incompatible diff --git a/go.sum b/go.sum index 1b52d70d5..296030c09 100644 --- a/go.sum +++ b/go.sum @@ -21,6 +21,8 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= +cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= @@ -34,40 +36,130 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= -filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +dubbo.apache.org/dubbo-go/v3 v3.3.0 h1:jhwK4nQ1DsKQ6H9p7icZx0jg9ulF1vpAA/c0Ly8Et4w= +dubbo.apache.org/dubbo-go/v3 v3.3.0/go.mod h1:zu2m9tUGaZYfuaMX82pLlwmq7Vl4s5eenZNBGdfAagc= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/RoaringBitmap/roaring v1.2.3 h1:yqreLINqIrX22ErkKI0vY47/ivtJr6n+kMhVOVmhWBY= +github.com/RoaringBitmap/roaring v1.2.3/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI= +github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.6 h1:eIf+iGJxdU4U9ypaUfbtOWCsZSbTb8AUHvyPrxu6mAA= +github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.6/go.mod h1:4EUIoxs/do24zMOGGqYVWgw0s9NtiylnJglOeEB5UJo= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 h1:zE8vH9C7JiZLNJJQ5OwjU9mSi4T9ef9u3BURT6LCLC8= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5/go.mod h1:tWnyE9AjF8J8qqLk645oUmVUnFybApTQWklQmi5tY6g= +github.com/alibabacloud-go/darabonba-array v0.1.0 h1:vR8s7b1fWAQIjEjWnuF0JiKsCvclSRTfDzZHTYqfufY= +github.com/alibabacloud-go/darabonba-array v0.1.0/go.mod h1:BLKxr0brnggqOJPqT09DFJ8g3fsDshapUD3C3aOEFaI= +github.com/alibabacloud-go/darabonba-encode-util v0.0.2 h1:1uJGrbsGEVqWcWxrS9MyC2NG0Ax+GpOM5gtupki31XE= +github.com/alibabacloud-go/darabonba-encode-util v0.0.2/go.mod h1:JiW9higWHYXm7F4PKuMgEUETNZasrDM6vqVr/Can7H8= +github.com/alibabacloud-go/darabonba-map v0.0.2 h1:qvPnGB4+dJbJIxOOfawxzF3hzMnIpjmafa0qOTp6udc= +github.com/alibabacloud-go/darabonba-map v0.0.2/go.mod h1:28AJaX8FOE/ym8OUFWga+MtEzBunJwQGceGQlvaPGPc= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.9/go.mod h1:bb+Io8Sn2RuM3/Rpme6ll86jMyFSrD1bxeV/+v61KeU= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10 h1:GEYkMApgpKEVDn6z12DcH1EGYpDYRB8JxsazM4Rywak= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10/go.mod h1:26a14FGhZVELuz2cc2AolvW4RHmIO3/HRwsdHhaIPDE= +github.com/alibabacloud-go/darabonba-signature-util v0.0.7 h1:UzCnKvsjPFzApvODDNEYqBHMFt1w98wC7FOo0InLyxg= +github.com/alibabacloud-go/darabonba-signature-util v0.0.7/go.mod h1:oUzCYV2fcCH797xKdL6BDH8ADIHlzrtKVjeRtunBNTQ= +github.com/alibabacloud-go/darabonba-string v1.0.2 h1:E714wms5ibdzCqGeYJ9JCFywE5nDyvIXIIQbZVFkkqo= +github.com/alibabacloud-go/darabonba-string v1.0.2/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY= +github.com/alibabacloud-go/debug v1.0.0/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc= +github.com/alibabacloud-go/debug v1.0.1 h1:MsW9SmUtbb1Fnt3ieC6NNZi6aEwrXfDksD4QA6GSbPg= +github.com/alibabacloud-go/debug v1.0.1/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc= +github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q= +github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= +github.com/alibabacloud-go/kms-20160120/v3 v3.2.3 h1:vamGcYQFwXVqR6RWcrVTTqlIXZVsYjaA7pZbx+Xw6zw= +github.com/alibabacloud-go/kms-20160120/v3 v3.2.3/go.mod h1:3rIyughsFDLie1ut9gQJXkWkMg/NfXBCk+OtXnPu3lw= +github.com/alibabacloud-go/openapi-util v0.1.0 h1:0z75cIULkDrdEhkLWgi9tnLe+KhAFE/r5Pb3312/eAY= +github.com/alibabacloud-go/openapi-util v0.1.0/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg= +github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.11/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.17/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.1.20/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.2.1/go.mod h1:qbzof29bM/IFhLMtJPrgTGK3eauV5J2wSyEUo4OEmnA= +github.com/alibabacloud-go/tea v1.2.2 h1:aTsR6Rl3ANWPfqeQugPglfurloyBJY85eFy7Gc1+8oU= +github.com/alibabacloud-go/tea v1.2.2/go.mod h1:CF3vOzEMAG+bR4WOql8gc2G9H3EkH3ZLAQdpmpXMgwk= +github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= +github.com/alibabacloud-go/tea-utils v1.4.4 h1:lxCDvNCdTo9FaXKKq45+4vGETQUKNOW/qKTcX9Sk53o= +github.com/alibabacloud-go/tea-utils v1.4.4/go.mod h1:KNcT0oXlZZxOXINnZBs6YvgOd5aYp9U67G+E3R8fcQw= +github.com/alibabacloud-go/tea-utils/v2 v2.0.3/go.mod h1:sj1PbjPodAVTqGTA3olprfeeqqmwD0A5OQz94o9EuXQ= +github.com/alibabacloud-go/tea-utils/v2 v2.0.5/go.mod h1:dL6vbUT35E4F4bFTHL845eUloqaerYBYPsdWR2/jhe4= +github.com/alibabacloud-go/tea-utils/v2 v2.0.6/go.mod h1:qxn986l+q33J5VkialKMqT/TTs3E+U9MJpd001iWQ9I= +github.com/alibabacloud-go/tea-utils/v2 v2.0.7 h1:WDx5qW3Xa5ZgJ1c8NfqJkF6w+AU5wB8835UdhPr6Ax0= +github.com/alibabacloud-go/tea-utils/v2 v2.0.7/go.mod h1:qxn986l+q33J5VkialKMqT/TTs3E+U9MJpd001iWQ9I= +github.com/alibabacloud-go/tea-xml v1.1.3 h1:7LYnm+JbOq2B+T/B0fHC4Ies4/FofC4zHzYtqw7dgt0= +github.com/alibabacloud-go/tea-xml v1.1.3/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.1800 h1:ie/8RxBOfKZWcrbYSJi2Z8uX8TcOlSMwPlEJh83OeOw= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.1800/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU= +github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.5.1 h1:nJYyoFP+aqGKgPs9JeZgS1rWQ4NndNR0Zfhh161ZltU= +github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.5.1/go.mod h1:WzGOmFFTlUzXM03CJnHWMQ85UN6QGpOXZocCjwkiyOg= +github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.8 h1:QeUdR7JF7iNCvO/81EhxEr3wDwxk4YBoYZOq6E0AjHI= +github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.8/go.mod h1:xP0KIZry6i7oGPF24vhAPr1Q8vLZRcMcxtft5xDKwCU= +github.com/aliyun/aliyun-secretsmanager-client-go v1.1.5 h1:8S0mtD101RDYa0LXwdoqgN0RxdMmmJYjq8g2mk7/lQ4= +github.com/aliyun/aliyun-secretsmanager-client-go v1.1.5/go.mod h1:M19fxYz3gpm0ETnoKweYyYtqrtnVtrpKFpwsghbw+cQ= +github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= +github.com/aliyun/credentials-go v1.3.1/go.mod h1:8jKYhQuDawt8x2+fusqa1Y6mPxemTsBEN04dgcAcYz0= +github.com/aliyun/credentials-go v1.3.6/go.mod h1:1LxUuX7L5YrZUWzBrRyk0SwSdH4OmPrib8NVePL3fxM= +github.com/aliyun/credentials-go v1.3.10/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U= +github.com/aliyun/credentials-go v1.4.3 h1:N3iHyvHRMyOwY1+0qBLSf3hb5JFiOujVSVuEpgeGttY= +github.com/aliyun/credentials-go v1.4.3/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/dubbo-go-hessian2 v1.9.1/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= +github.com/apache/dubbo-go-hessian2 v1.9.3/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= +github.com/apache/dubbo-go-hessian2 v1.12.5 h1:19lJz2Md0EYF2bOtEvFqXEQRYvLz04GfsoocsBWlLWQ= +github.com/apache/dubbo-go-hessian2 v1.12.5/go.mod h1:QP9Tc0w/B/mDopjusebo/c7GgEfl6Lz8jeuFg8JA6yw= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= +github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bufbuild/protocompile v0.10.0 h1:+jW/wnLMLxaCEG8AX9lD0bQ5v9h1RUiMKOBOT5ll9dM= github.com/bufbuild/protocompile v0.10.0/go.mod h1:G9qQIQo0xZ6Uyj6CMNz0saGmx2so+KONo8/KrELABiY= +github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bytedance/sonic v1.13.2 h1:8/H1FempDZqC4VqjptGo14QQlJx8VdZJegxs6wwfqpQ= github.com/bytedance/sonic v1.13.2/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -78,6 +170,9 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E= +github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= @@ -85,42 +180,73 @@ github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +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-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f h1:C5bqEmzEPLsHm9Mv73lSE9e9bKV23aB1vxOsmZrkl3k= github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creasty/defaults v1.5.2 h1:/VfB6uxpyp6h0fr7SPp7n8WJBoV8jfxQXPCnkVSjyls= +github.com/creasty/defaults v1.5.2/go.mod h1:FPZ+Y0WNrbqOVw+c6av63eyHUAl6pMHZwqLPvXUZGfY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= +github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= +github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= +github.com/dubbogo/gost v1.11.18/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= +github.com/dubbogo/gost v1.13.1/go.mod h1:9HMXBv+WBMRWhF3SklpqDjkS/01AKWm2SrVdz/A0xJI= github.com/dubbogo/gost v1.14.0 h1:yc5YfozvUBAChAox8H7CkmHb6/TvF6cKdqZNJNv2jdE= github.com/dubbogo/gost v1.14.0/go.mod h1:YP28JweR+hhJdikP3bZ3bVKUWWI313xX1rgLaEE0FvQ= +github.com/dubbogo/grpc-go v1.42.10 h1:CoyCdtqKJEar/3rPa6peZbDqYZ/mVsCqAxB6TfTSkhQ= +github.com/dubbogo/grpc-go v1.42.10/go.mod h1:JMkPt1mIHL96GAFeYsMoMjew6f1ROKycikGzZQH1s5U= +github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU= +github.com/dubbogo/net v0.0.4/go.mod h1:1CGOnM7X3he+qgGNqjeADuE5vKZQx/eMSeUkpU3ujIc= +github.com/dubbogo/triple v1.0.9/go.mod h1:1t9me4j4CTvNDcsMZy6/OGarbRyAUSY0tFXGXHCp7Iw= github.com/duke-git/lancet/v2 v2.3.6 h1:NKxSSh+dlgp37funvxLCf3xLBeUYa7VW1thYQP6j3Y8= github.com/duke-git/lancet/v2 v2.3.6/go.mod h1:zGa2R4xswg6EG9I6WnyubDbFO/+A/RROxIbXcwryTsc= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/go-control-plane v0.13.4 h1:zEqyPVyku6IvWCFwux4x9RxkLOMUL+1vC9xUFv5l2/M= github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA= @@ -131,8 +257,11 @@ github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJP github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= +github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fullstorydev/grpcurl v1.9.1 h1:YxX1aCcCc4SDBQfj9uoWcTLe8t4NWrZe1y+mk83BQgo= github.com/fullstorydev/grpcurl v1.9.1/go.mod h1:i8gKLIC6s93WdU3LSmkE5vtsCxyRmihUj5FK1cNW5EM= @@ -144,10 +273,15 @@ github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49P github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sessions v1.0.4 h1:ha6CNdpYiTOK/hTp05miJLbpTSNfOnFg5Jm2kbcqy8U= github.com/gin-contrib/sessions v1.0.4/go.mod h1:ccmkrb2z6iU2osiAHZG3x3J4suJK+OU27oqzlWOqQgs= -github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E= -github.com/gin-contrib/sse v1.0.0/go.mod h1:zNuFdwarAygJBht0NTKiSi3jRf6RbqeILZ9Sp6Slhe0= +github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w= +github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM= +github.com/gin-contrib/zap v1.1.6 h1:TZcXi1UR8QG6OO4rewIMth7SmweyZuCeuUyJohpRcXg= +github.com/gin-contrib/zap v1.1.6/go.mod h1:V/sSE4Rf6ptzsEW4vj1KpUUV8ptJSVdE1nqsX9HQ1II= github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ= github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-co-op/gocron v1.9.0 h1:+V+DDenw3ryB7B+tK1bAIC5p0ruw4oX9IqAsdRnGIf0= +github.com/go-co-op/gocron v1.9.0/go.mod h1:DbJm9kdgr1sEvWpHCA7dFFs/PGHPMil9/97EXCRPr4k= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -155,16 +289,19 @@ github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3 github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= @@ -180,8 +317,7 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k= github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo= -github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= -github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= @@ -190,13 +326,17 @@ github.com/goburrow/cache v0.1.4/go.mod h1:cDFesZDnIlrHoNlMYqqMpCRawuXulgx+y7mXU github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -208,6 +348,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -227,6 +368,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= @@ -260,29 +402,40 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/context v1.1.2 h1:WRkNAv2uoa03QNIc1A6u4O7DAGMUVoopZhkiXWA2V1o= github.com/gorilla/context v1.1.2/go.mod h1:KDPwT9i/MeWHiLl90fuTgrt4/wPcv75vFAZLaOOcbxM= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.4.0 h1:kpIYOp/oi6MG/p5PgxApU8srsSw9tuFbt46Lt7auzqQ= github.com/gorilla/sessions v1.4.0/go.mod h1:FLWm50oby91+hl7p/wRxDth9bWSuk0qVL2emc7lT5ik= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -293,6 +446,7 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -303,25 +457,25 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hoisie/mustache v0.0.0-20160804235033-6375acf62c69 h1:umaj0TCQ9lWUUKy2DxAhEzPbwd0jnxiw1EI2z3FiILM= github.com/hoisie/mustache v0.0.0-20160804235033-6375acf62c69/go.mod h1:zdLK9ilQRSMjSeLKoZ4BqUfBT7jswTGF8zRlKEsiRXA= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.6.0 h1:SWJzexBzPL5jb0GEsrPMLIsi/3jOo7RHlzTjcAeDrPY= -github.com/jackc/pgx/v5 v5.6.0/go.mod h1:DNZ/vlrUnhWCoFGxHAG8U2ljioxukquj7utPDgtQdTw= -github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= -github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/tdigest v0.0.1 h1:XpFptwYmnEKUqmkcDjrzffswZ3nvNeevbUSLPP/ZzIY= +github.com/influxdata/tdigest v0.0.1/go.mod h1:Z0kXnxzbTC2qrx4NaIzYkE1k66+6oEDQTvL95hQFh5Y= +github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= github.com/jhump/protoreflect v1.16.0 h1:54fZg+49widqXYQ0b+usAFHbMkBGR4PpXrsHc8+TBDg= github.com/jhump/protoreflect v1.16.0/go.mod h1:oYPd7nPvcBw/5wlDfm/AVmU9zH9BgqGCI469pGxfj/8= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= +github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -329,6 +483,8 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -366,17 +522,27 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE= +github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8= +github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= -github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -396,26 +562,63 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= +github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nacos-group/nacos-sdk-go v1.0.8/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= +github.com/nacos-group/nacos-sdk-go/v2 v2.1.2/go.mod h1:ys/1adWeKXXzbNWfRNbaFlX/t6HVLWdpsNDvmoWTw0g= github.com/nacos-group/nacos-sdk-go/v2 v2.2.2/go.mod h1:ys/1adWeKXXzbNWfRNbaFlX/t6HVLWdpsNDvmoWTw0g= +github.com/nacos-group/nacos-sdk-go/v2 v2.3.5 h1:Hux7C4N4rWhwBF5Zm4yyYskrs9VTgrRTA8DZjoEhQTs= +github.com/nacos-group/nacos-sdk-go/v2 v2.3.5/go.mod h1:ygUBdt7eGeYBt6Lz2HO3wx7crKXk25Mp80568emGMWU= +github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo/v2 v2.22.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM= github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/orcaman/concurrent-map v0.0.0-20210501183033-44dafcb38ecc h1:Ak86L+yDSOzKFa7WM5bf5itSOo1e3Xh8bm5YCMUXIjQ= +github.com/orcaman/concurrent-map v0.0.0-20210501183033-44dafcb38ecc/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -424,30 +627,39 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY= github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= @@ -458,15 +670,20 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shirou/gopsutil v3.20.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.22.2/go.mod h1:WapW1AOOPlHyXr+yOyw3uYx36enocrtSoSBy0L5vUHY= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -476,24 +693,33 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/slok/go-http-metrics v0.11.0 h1:ABJUpekCZSkQT1wQrFvS4kGbhea/w6ndFJaWJeh3zL0= github.com/slok/go-http-metrics v0.11.0/go.mod h1:ZGKeYG1ET6TEJpQx18BqAJAvxw9jBAZXCHU7bWQqqAc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5-0.20210205191134-5ec6847320e5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spiffe/go-spiffe/v2 v2.5.0 h1:N2I01KCUkv1FAjZXJMwh95KK1ZIQLYbPfhaxw8WS0hE= github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= @@ -506,39 +732,55 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= +github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= +github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho= +github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3/go.mod h1:QDlpd3qS71vYtakd2hmdpqhJ9nwv6mD6A30bQ1BPBFE= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= +github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM= github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0-alpha.0/go.mod h1:mPcW6aZJukV6Aa81LSKpBjQXTWlXB5r74ymPoSWa3Sw= go.etcd.io/etcd/client/v2 v2.305.0-alpha.0/go.mod h1:kdV+xzCJ3luEBSIeQyB/OEKkWKd8Zkux4sbDeANrosU= go.etcd.io/etcd/client/v3 v3.5.0-alpha.0/go.mod h1:wKt7jgDgf/OfKiYmCq5WFGxOFAkVMLxiiXgLDFhECr8= go.etcd.io/etcd/pkg/v3 v3.5.0-alpha.0/go.mod h1:tV31atvwzcybuqejDoY3oaNRTtlD2l/Ot78Pc9w7DMY= go.etcd.io/etcd/raft/v3 v3.5.0-alpha.0/go.mod h1:FAwse6Zlm5v4tEWZaTjmNhe17Int4Oxbu7+2r0DiD3w= go.etcd.io/etcd/server/v3 v3.5.0-alpha.0/go.mod h1:tsKetYpt980ZTpzl/gb+UOJj9RkIyCb1u4wjzMg90BQ= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -546,6 +788,8 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/propagators/b3 v1.10.0 h1:6AD2VV8edRdEYNaD8cNckpzgdMLU2kbV9OYyxt2kvCg= +go.opentelemetry.io/contrib/propagators/b3 v1.10.0/go.mod h1:oxvamQ/mTDFQVugml/uFS59+aEUnFLhmd1wsG+n5MOE= go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= @@ -557,20 +801,27 @@ go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstF go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -582,11 +833,22 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= -golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= +golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -621,13 +883,17 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -638,6 +904,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -654,18 +921,31 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.0.0-20211105192438-b53810dc28af/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= +golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc= golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -680,14 +960,17 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= -golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= +golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -697,13 +980,16 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -713,6 +999,7 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -723,39 +1010,71 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201223074533-0d417f636930/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211106132015-ebca88c72f68/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= -golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= +golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= +golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -783,6 +1102,7 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -795,6 +1115,7 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -806,12 +1127,18 @@ golang.org/x/tools v0.0.0-20201014170642-d1624618ad65/go.mod h1:z6u4i615ZeAfBE4X golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= -golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= +golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca h1:PupagGYwj8+I4ubCxcmcBRk3VlUWtTg5huQpZR9flmE= +gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -829,6 +1156,7 @@ google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -839,6 +1167,7 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -864,15 +1193,23 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210106152847-07624b53cd92/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 h1:hE3bRWtU6uceqlh4fhrSnUyjKHMKB9KrTLLG+bc0ddM= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463/go.mod h1:U90ffi8eUL9MwPcrJylN5+Mk2v3vuPDptd5yyNUiRR8= google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -884,6 +1221,7 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= @@ -900,25 +1238,36 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -933,14 +1282,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.6.0 h1:eNbLmNTpPpTOVZi8MMxCi2aaIm0ZpInbORNXDwyLGvg= -gorm.io/driver/mysql v1.6.0/go.mod h1:D/oCC2GWK3M/dqoLxnOlaNKmXz8WNTfcS9y5ovaSqKo= -gorm.io/driver/postgres v1.6.0 h1:2dxzU8xJ+ivvqTRph34QX+WrRaJlmfyPqXmoGVjMBa4= -gorm.io/driver/postgres v1.6.0/go.mod h1:vUw0mrGgrTK+uPHEhAdV4sfFELrByKVGnaVRkXDhtWo= -gorm.io/driver/sqlite v1.5.7 h1:8NvsrhP0ifM7LX9G4zPB97NwovUakUxc+2V2uuf3Z1I= -gorm.io/driver/sqlite v1.5.7/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDah4= -gorm.io/gorm v1.30.0 h1:qbT5aPv1UH8gI99OsRlvDToLxW5zR7FzS9acZDOZcgs= -gorm.io/gorm v1.30.0/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -970,6 +1313,8 @@ sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1 sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/nacos b/nacos new file mode 100644 index 000000000..6d0553ef7 --- /dev/null +++ b/nacos @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + Nacos + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/pkg/common/bizerror/common.go b/pkg/common/bizerror/common.go index b8201e952..1c25f600e 100644 --- a/pkg/common/bizerror/common.go +++ b/pkg/common/bizerror/common.go @@ -22,11 +22,11 @@ import ( ) func NewAssertionError(expected, actual interface{}) Error { - return NewBizError(UnknownError, fmt.Sprintf("type assertion error, expected:%v, actual:%v", expected, actual)) + return New(UnknownError, fmt.Sprintf("type assertion error, expected:%v, actual:%v", expected, actual)) } func NewUnauthorizedError() Error { - return NewBizError(Unauthorized, "no access, please login") + return New(Unauthorized, "no access, please login") } func MeshNotFoundError(mesh string) Error { - return NewBizError(UnknownError, fmt.Sprintf("mesh of name %s is not found", mesh)) + return New(UnknownError, fmt.Sprintf("mesh of name %s is not found", mesh)) } diff --git a/pkg/common/bizerror/error.go b/pkg/common/bizerror/error.go index b65b023dc..6c09f26c2 100644 --- a/pkg/common/bizerror/error.go +++ b/pkg/common/bizerror/error.go @@ -17,6 +17,8 @@ package bizerror +import "fmt" + type Error interface { Code() ErrorCode Message() string @@ -33,17 +35,30 @@ const ( AppNotFound ErrorCode = "AppNotFound" Unauthorized ErrorCode = "Unauthorized" SessionError ErrorCode = "SessionError" + DiscoveryError ErrorCode = "DiscoveryError" + ConfigError ErrorCode = "ConfigError" + NacosError ErrorCode = "NacosError" + EventError ErrorCode = "EventError" ) type bizError struct { code ErrorCode message string + cause error } var _ Error = &bizError{} -func NewBizError(code ErrorCode, message string) Error { +func New(code ErrorCode, message string) Error { + return &bizError{ + code: code, + message: message, + } +} + +func Wrap(cause error, code ErrorCode, message string) Error { return &bizError{ + cause: cause, code: code, message: message, } @@ -58,9 +73,12 @@ func (b *bizError) Message() string { } func (b *bizError) Error() string { + if b.cause != nil { + return fmt.Sprintf("%s, cause: %s", b.String(), b.cause.Error()) + } return b.String() } func (b *bizError) String() string { - return string(b.code) + ": " + b.message + return "[" + string(b.code) + "], " + b.message } diff --git a/pkg/console/constants/constants.go b/pkg/common/constants/constants.go similarity index 75% rename from pkg/console/constants/constants.go rename to pkg/common/constants/constants.go index a6000fe05..bed5214f9 100644 --- a/pkg/console/constants/constants.go +++ b/pkg/common/constants/constants.go @@ -27,6 +27,14 @@ const ( DefaultRegisterModeInterface = "interface" DefaultRegisterModeInstance = "instance" DefaultRegisterModeAll = "all" + VersionKey = "version" + GroupKey = "group" + MetadataStorageTypeKey = "dubbo.metadata.storage-type" + TimestampKey = "timestamp" + EndpointsKey = "dubbo.endpoints" + InterfaceKey = "interface" + URLParamsKey = "dubbo.metadata-service.url-params" + MetadataRevisionKey = "dubbo.metadata.revision" ) const ( @@ -60,3 +68,14 @@ const ( Stateful = "有状态" Stateless = "无状态" ) + +const ( + PathSeparator = "/" + DotSeparator = "." + ColonSeparator = ":" + CommaSeparator = "," +) + +const ( + DefaultMesh = "default" +) diff --git a/pkg/config/discovery/config.go b/pkg/config/discovery/config.go index ee63eed42..0109bd378 100644 --- a/pkg/config/discovery/config.go +++ b/pkg/config/discovery/config.go @@ -28,17 +28,23 @@ type Type string const ( Zookeeper Type = "zookeeper" - Nacos Type = "nacos" + Nacos2 Type = "nacos2" // Mock is only for develop and test Mock Type = "mock" ) +const ( + defaultConfigWatchPeriod = 30 + defaultServiceWatchPeriod = 30 +) + // Config defines Discovery configuration type Config struct { config.BaseConfig - Name string `json:"name"` - Type Type `json:"type"` - Address AddressConfig `json:"address"` + Name string `json:"name"` + Type Type `json:"type"` + Address AddressConfig `json:"address"` + Properties Properties `json:"properties"` } // AddressConfig defines Discovery Engine address @@ -47,11 +53,15 @@ type AddressConfig struct { ConfigCenter string `json:"configCenter"` MetadataReport string `json:"metadataReport"` } +type Properties struct { + ConfigWatchPeriod int `json:"configWatchPeriod"` + ServiceWatchPeriod int `json:"serviceWatchPeriod"` +} func DefaultDiscoveryEnginConfig() *Config { return &Config{ Name: "localhost", - Type: Nacos, + Type: Nacos2, Address: AddressConfig{ Registry: "nacos://127.0.0.1:8848?username=nacos&password=nacos", ConfigCenter: "nacos://127.0.0.1:8848?username=nacos&password=nacos", @@ -60,12 +70,30 @@ func DefaultDiscoveryEnginConfig() *Config { } } +func (c *Config) PreProcess() error { + if strutil.IsBlank(c.Address.Registry) && c.Type != Mock { + return bizerror.New(bizerror.ConfigError, "registry address is needed") + } + // if config center or metadata report is not set, use registry address + if strutil.IsBlank(c.Address.ConfigCenter) { + c.Address.ConfigCenter = c.Address.Registry + } + if strutil.IsBlank(c.Address.MetadataReport) { + c.Address.MetadataReport = c.Address.Registry + } + if c.Properties.ServiceWatchPeriod <= 0 { + c.Properties.ServiceWatchPeriod = defaultServiceWatchPeriod + c.Properties.ConfigWatchPeriod = defaultConfigWatchPeriod + } + return nil +} + func (c *Config) Validate() error { if strutil.IsBlank(c.Name) { - return bizerror.NewBizError(bizerror.InvalidArgument, "discovery name is needed") + return bizerror.New(bizerror.InvalidArgument, "discovery name is needed") } if strutil.IsBlank(string(c.Type)) { - return bizerror.NewBizError(bizerror.InvalidArgument, "discovery type is needed") + return bizerror.New(bizerror.InvalidArgument, "discovery type is needed") } return nil } diff --git a/pkg/config/engine/config.go b/pkg/config/engine/config.go index 299620edc..ecd90963f 100644 --- a/pkg/config/engine/config.go +++ b/pkg/config/engine/config.go @@ -36,7 +36,9 @@ type Config struct { type Properties struct { KubeConfigPath string `json:"kubeConfigPath"` PodWatchSelector string `json:"podWatchSelector"` - DubboAppIdentifier *DubboAppIdentifier `json:"dubboAppIdentifier"` + DubboAppIdentifier *KubernetesIdentifier `json:"dubboAppIdentifier"` + DubboRPCPortIdentifier *KubernetesIdentifier `json:"dubboRPCPortIdentifier"` + DubboRegistryIdentifier *KubernetesIdentifier `json:"dubboRegistryIdentifier"` MainContainerChooseStrategy *MainContainerChooseStrategy `json:"mainContainerChooseStrategy"` } @@ -66,18 +68,17 @@ type MainContainerChooseStrategy struct { AnnotationKey string `json:"annotationKey"` } -type DubboAppIdentifierType string +type IdentifierType string const ( - IdentifyByLabel DubboAppIdentifierType = "ByLabel" - IdentifyByAnnotation DubboAppIdentifierType = "ByAnnotation" - IdentifyByIP DubboAppIdentifierType = "ByIP" + IdentifyByLabel IdentifierType = "ByLabel" + IdentifyByAnnotation IdentifierType = "ByAnnotation" ) -type DubboAppIdentifier struct { - Type DubboAppIdentifierType `json:"type"` - LabelKey string `json:"labelKey"` - AnnotationKey string `json:"annotationKey"` +type KubernetesIdentifier struct { + Type IdentifierType `json:"type"` + LabelKey string `json:"labelKey"` + AnnotationKey string `json:"annotationKey"` } func DefaultResourceEngineConfig() *Config { diff --git a/pkg/config/loader.go b/pkg/config/loader.go index 8dae68124..522908c5d 100644 --- a/pkg/config/loader.go +++ b/pkg/config/loader.go @@ -18,13 +18,14 @@ package config import ( + "fmt" "os" "github.com/kelseyhightower/envconfig" "github.com/pkg/errors" "sigs.k8s.io/yaml" - "github.com/apache/dubbo-admin/pkg/core" + "github.com/apache/dubbo-admin/pkg/common/bizerror" ) func Load(file string, cfg Config) error { @@ -33,24 +34,29 @@ func Load(file string, cfg Config) error { func LoadWithOption(file string, cfg Config, strict bool, includeEnv bool, validate bool) error { if file == "" { - core.Log.WithName("config").Info("skipping reading config from file") - } else if err := loadFromFile(file, cfg, strict); err != nil { - return err + return bizerror.New(bizerror.ConfigError, "config file is needed") + } + if err := loadFromFile(file, cfg, strict); err != nil { + return fmt.Errorf("configuration loading failed, %w", err) + } + + if err := cfg.PreProcess(); err != nil { + return fmt.Errorf("configuration pre processing failed, %w", err) } if includeEnv { if err := envconfig.Process("", cfg); err != nil { - return err + return fmt.Errorf("configuration environment processing failed, %w", err) } } if err := cfg.PostProcess(); err != nil { - return errors.Wrap(err, "configuration post processing failed") + return fmt.Errorf("configuration post processing failed, %w", err) } if validate { if err := cfg.Validate(); err != nil { - return errors.Wrapf(err, "Invalid configuration") + return fmt.Errorf("configuration validation failed, %w", err) } } return nil diff --git a/pkg/console/component.go b/pkg/console/component.go index 985b78f66..2457a9de9 100644 --- a/pkg/console/component.go +++ b/pkg/console/component.go @@ -24,9 +24,11 @@ import ( "net/http" "strconv" "strings" + "time" "github.com/gin-contrib/sessions" "github.com/gin-contrib/sessions/cookie" + ginzap "github.com/gin-contrib/zap" "github.com/gin-gonic/gin" ui "github.com/apache/dubbo-admin/app/dubbo-ui" @@ -76,6 +78,8 @@ func (c *consoleWebServer) Init(ctx runtime.BuilderContext) error { store := cookie.NewStore([]byte("secret")) r.Use(sessions.Sessions("session", store)) r.Use(c.authMiddleware()) + r.Use(ginzap.Ginzap(logger.Logger(), time.RFC3339, true)) + r.Use(ginzap.RecoveryWithZap(logger.Logger(), true)) c.Engine = r c.cfg = ctx.Config().Console return nil @@ -131,7 +135,7 @@ func (c *consoleWebServer) authMiddleware() gin.HandlerFunc { session := sessions.Default(c) user := session.Get("user") if user == nil { - authErr := bizerror.NewBizError(bizerror.Unauthorized, "no access, please login") + authErr := bizerror.New(bizerror.Unauthorized, "no access, please login") c.JSON(http.StatusUnauthorized, model.NewBizErrorResp(authErr)) c.Abort() return diff --git a/pkg/console/handler/auth.go b/pkg/console/handler/auth.go index 0ec4dcf76..1d2b7c1ab 100644 --- a/pkg/console/handler/auth.go +++ b/pkg/console/handler/auth.go @@ -35,7 +35,7 @@ func Login(ctx consolectx.Context) gin.HandlerFunc { // verify username and password authCfg := ctx.Config().Console.Auth if user != authCfg.User || password != authCfg.Password { - authErr := bizerror.NewBizError(bizerror.Unauthorized, "username or password is not correct!") + authErr := bizerror.New(bizerror.Unauthorized, "username or password is not correct!") c.JSON(http.StatusUnauthorized, model.NewBizErrorResp(authErr)) return } @@ -47,7 +47,7 @@ func Login(ctx consolectx.Context) gin.HandlerFunc { }) err := session.Save() if err != nil { - sessionErr := bizerror.NewBizError(bizerror.SessionError, err.Error()) + sessionErr := bizerror.New(bizerror.SessionError, err.Error()) c.JSON(http.StatusOK, model.NewBizErrorResp(sessionErr)) return } @@ -61,7 +61,7 @@ func Logout(_ consolectx.Context) gin.HandlerFunc { session.Clear() err := session.Save() if err != nil { - sessionErr := bizerror.NewBizError(bizerror.SessionError, err.Error()) + sessionErr := bizerror.New(bizerror.SessionError, err.Error()) c.JSON(http.StatusOK, model.NewBizErrorResp(sessionErr)) return } diff --git a/pkg/console/handler/observability.go b/pkg/console/handler/observability.go index 79f3b0a43..447d56cc1 100644 --- a/pkg/console/handler/observability.go +++ b/pkg/console/handler/observability.go @@ -22,7 +22,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/apache/dubbo-admin/pkg/console/constants" + "github.com/apache/dubbo-admin/pkg/common/constants" consolectx "github.com/apache/dubbo-admin/pkg/console/context" "github.com/apache/dubbo-admin/pkg/console/model" "github.com/apache/dubbo-admin/pkg/console/service" diff --git a/pkg/console/model/application.go b/pkg/console/model/application.go index 5b02b674b..2d226032e 100644 --- a/pkg/console/model/application.go +++ b/pkg/console/model/application.go @@ -18,7 +18,7 @@ package model import ( - "github.com/apache/dubbo-admin/pkg/console/constants" + "github.com/apache/dubbo-admin/pkg/common/constants" "github.com/apache/dubbo-admin/pkg/core/consts" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" diff --git a/pkg/console/model/instance.go b/pkg/console/model/instance.go index 1ceecc681..d53a7227a 100644 --- a/pkg/console/model/instance.go +++ b/pkg/console/model/instance.go @@ -106,7 +106,7 @@ type State struct { } type InstanceDetailResp struct { - RpcPort int32 `json:"rpcPort"` + RpcPort int64 `json:"rpcPort"` Ip string `json:"ip"` AppName string `json:"appName"` WorkloadName string `json:"workloadName"` diff --git a/pkg/console/service/application.go b/pkg/console/service/application.go index 836c7019f..cf4656764 100644 --- a/pkg/console/service/application.go +++ b/pkg/console/service/application.go @@ -297,7 +297,7 @@ func UpInsertAppAccessLog(ctx consolectx.Context, appName string, openAccessLog return err } if data == nil { - return bizerror.NewBizError(bizerror.AppNotFound, fmt.Sprintf("%s does not exist", appName)) + return bizerror.New(bizerror.AppNotFound, fmt.Sprintf("%s does not exist", appName)) } // check app configurator exists appConfiguratorName := appName + consts.ConfiguratorRuleSuffix @@ -478,7 +478,7 @@ func UpInsertAppFlowWeightConfig(ctx consolectx.Context, appName string, mesh st return err } if data == nil { - return bizerror.NewBizError(bizerror.AppNotFound, fmt.Sprintf("%s does not exist", appName)) + return bizerror.New(bizerror.AppNotFound, fmt.Sprintf("%s does not exist", appName)) } appConfiguratorName := appName + consts.ConfiguratorRuleSuffix res, err := GetConfigurator(ctx, appConfiguratorName, mesh) diff --git a/pkg/console/service/instance.go b/pkg/console/service/instance.go index 2686390d5..bf43a58a9 100644 --- a/pkg/console/service/instance.go +++ b/pkg/console/service/instance.go @@ -119,7 +119,7 @@ func GetInstanceMetrics(ctx consolectx.Context, req *model.MetricsReq) ([]*model return []*model.MetricsResp{metricsResp}, nil } -func fetchMetricsData(ip string, port int32) ([]model.Metric, error) { +func fetchMetricsData(ip string, port int64) ([]model.Metric, error) { url := fmt.Sprintf("http://%s:%d/metrics", ip, port) response, err := http.Get(url) if err != nil { diff --git a/pkg/console/util/error.go b/pkg/console/util/error.go index 62eb3287e..a4dcab169 100644 --- a/pkg/console/util/error.go +++ b/pkg/console/util/error.go @@ -30,12 +30,12 @@ import ( func HandleServiceError(ctx *gin.Context, err error) { var e bizerror.Error if !errors.As(err, &e) { - e = bizerror.NewBizError(bizerror.UnknownError, err.Error()) + e = bizerror.New(bizerror.UnknownError, err.Error()) } ctx.JSON(http.StatusOK, model.NewBizErrorResp(e)) } func HandleArgumentError(ctx *gin.Context, err error) { - e := bizerror.NewBizError(bizerror.InvalidArgument, err.Error()) + e := bizerror.New(bizerror.InvalidArgument, err.Error()) ctx.JSON(http.StatusOK, model.NewBizErrorResp(e)) } diff --git a/pkg/core/bootstrap/init.go b/pkg/core/bootstrap/init.go index 41aee6047..8b2835401 100644 --- a/pkg/core/bootstrap/init.go +++ b/pkg/core/bootstrap/init.go @@ -26,6 +26,7 @@ import ( _ "github.com/apache/dubbo-admin/pkg/core/manager" _ "github.com/apache/dubbo-admin/pkg/core/store" _ "github.com/apache/dubbo-admin/pkg/discovery/mock" + _ "github.com/apache/dubbo-admin/pkg/discovery/nacos2" _ "github.com/apache/dubbo-admin/pkg/engine/kubernetes" _ "github.com/apache/dubbo-admin/pkg/store/memory" _ "github.com/apache/dubbo-admin/pkg/store/mysql" diff --git a/pkg/core/discovery/component.go b/pkg/core/discovery/component.go index 2bc0476b8..a754ce219 100644 --- a/pkg/core/discovery/component.go +++ b/pkg/core/discovery/component.go @@ -25,8 +25,10 @@ import ( "github.com/apache/dubbo-admin/pkg/common/bizerror" "github.com/apache/dubbo-admin/pkg/config/discovery" "github.com/apache/dubbo-admin/pkg/core/controller" + "github.com/apache/dubbo-admin/pkg/core/discovery/subscriber" "github.com/apache/dubbo-admin/pkg/core/events" "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" "github.com/apache/dubbo-admin/pkg/core/runtime" "github.com/apache/dubbo-admin/pkg/core/store" @@ -46,12 +48,16 @@ var _ Component = &discoveryComponent{} type Informers []controller.Informer type discoveryComponent struct { - discoveryInformers map[string]Informers + configs []*discovery.Config + informers map[string]Informers + subscribers []events.Subscriber + subscriptionMgr events.SubscriptionManager } func newDiscoveryComponent() Component { return &discoveryComponent{ - discoveryInformers: make(map[string]Informers), + informers: make(map[string]Informers), + subscribers: make([]events.Subscriber, 0), } } @@ -64,19 +70,50 @@ func (d *discoveryComponent) Order() int { } func (d *discoveryComponent) Init(ctx runtime.BuilderContext) error { - configs := ctx.Config().Discovery - for _, cfg := range configs { - informers, err := d.newInformers(cfg, ctx) + eventBusComponent, err := ctx.GetActivatedComponent(runtime.EventBus) + if err != nil { + return bizerror.New(bizerror.UnknownError, + fmt.Sprintf("can not retrieve event bus from runtime in discovery, %s", err)) + } + eventBus, ok := eventBusComponent.(events.EventBus) + if !ok { + return bizerror.NewAssertionError("EventBus", reflect.TypeOf(eventBusComponent).Name()) + } + d.subscriptionMgr = eventBus + storeComponent, err := ctx.GetActivatedComponent(runtime.ResourceStore) + if err != nil { + return bizerror.New(bizerror.UnknownError, + fmt.Sprintf("can not retrieve store from runtime in discovery, %s", err)) + } + storeRouter, ok := storeComponent.(store.Router) + if !ok { + return bizerror.NewAssertionError("store.Router", reflect.TypeOf(storeComponent).Name()) + } + d.configs = ctx.Config().Discovery + for _, cfg := range d.configs { + informers, err := d.initInformers(cfg, storeRouter, eventBus) if err != nil { return err } - d.discoveryInformers[cfg.Name] = informers + d.informers[cfg.Name] = informers + } + err = d.initSubscribes(storeRouter, eventBus) + if err != nil { + return err } return nil } func (d *discoveryComponent) Start(_ runtime.Runtime, ch <-chan struct{}) error { - for name, informers := range d.discoveryInformers { + // 1. subscribe resource changed events + for _, sub := range d.subscribers { + err := d.subscriptionMgr.Subscribe(sub) + if err != nil { + return bizerror.Wrap(err, bizerror.EventError, + fmt.Sprintf("subscriber %s in discovery %s can not subscribe resource changed events", sub.Name())) + } + } + for name, informers := range d.informers { for _, informer := range informers { go informer.Run(ch) } @@ -100,7 +137,7 @@ func (d *discoveryComponent) Delete(resource coremodel.Resource) error { panic("implement me") } -func (d *discoveryComponent) newInformers(cfg *discovery.Config, ctx runtime.BuilderContext) (Informers, error) { +func (d *discoveryComponent) initInformers(cfg *discovery.Config, storeRouter store.Router, emitter events.Emitter) (Informers, error) { factory, err := ListWatcherFactoryRegistry().GetListWatcherFactory(cfg.Type) if err != nil { return nil, err @@ -109,22 +146,6 @@ func (d *discoveryComponent) newInformers(cfg *discovery.Config, ctx runtime.Bui if err != nil { return nil, err } - eventBusComponent, err := ctx.GetActivatedComponent(runtime.EventBus) - if err != nil { - return nil, err - } - emitter, ok := eventBusComponent.(events.Emitter) - if !ok { - return nil, bizerror.NewAssertionError("Emitter", reflect.TypeOf(eventBusComponent).Name()) - } - storeComponent, err := ctx.GetActivatedComponent(runtime.ResourceStore) - if err != nil { - return nil, fmt.Errorf("can not retrieve store from runtime in engine %s, %w", cfg.Name, err) - } - storeRouter, ok := storeComponent.(store.Router) - if !ok { - return nil, bizerror.NewAssertionError("store.Router", reflect.TypeOf(storeComponent).Name()) - } var informers = make([]controller.Informer, len(lwList)) for i, lw := range lwList { resourceStore, err := storeRouter.ResourceKindRoute(lw.ResourceKind()) @@ -136,3 +157,13 @@ func (d *discoveryComponent) newInformers(cfg *discovery.Config, ctx runtime.Bui } return informers, nil } + +func (d *discoveryComponent) initSubscribes(storeRouter store.Router, emitter events.Emitter) error { + rs, err := storeRouter.ResourceKindRoute(meshresource.InstanceKind) + if err != nil { + return fmt.Errorf("can not find store for resource kind %s, %w", meshresource.InstanceKind, err) + } + rpcInstanceSub := subscriber.NewRPCInstanceEventSubscriber(rs, emitter) + d.subscribers = append(d.subscribers, rpcInstanceSub) + return nil +} diff --git a/pkg/core/discovery/subscriber/rpc_instance.go b/pkg/core/discovery/subscriber/rpc_instance.go new file mode 100644 index 000000000..61a09c813 --- /dev/null +++ b/pkg/core/discovery/subscriber/rpc_instance.go @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package subscriber + +import ( + "reflect" + + "github.com/duke-git/lancet/v2/strutil" + "k8s.io/client-go/tools/cache" + + "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" + "github.com/apache/dubbo-admin/pkg/core/events" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" + "github.com/apache/dubbo-admin/pkg/core/store" +) + +type RPCInstanceEventSubscriber struct { + instanceStore store.ResourceStore + eventEmitter events.Emitter +} + +func NewRPCInstanceEventSubscriber(instanceStore store.ResourceStore, emitter events.Emitter) *RPCInstanceEventSubscriber { + return &RPCInstanceEventSubscriber{ + instanceStore: instanceStore, + eventEmitter: emitter, + } +} + +func (s *RPCInstanceEventSubscriber) Name() string { + return "Discovery-" + s.ResourceKind().ToString() +} + +func (s *RPCInstanceEventSubscriber) ResourceKind() coremodel.ResourceKind { + return meshresource.RPCInstanceKind +} + +func (s *RPCInstanceEventSubscriber) ProcessEvent(event events.Event) error { + newObj, ok := event.NewObj().(*meshresource.RPCInstanceResource) + if !ok && event.NewObj() != nil { + return bizerror.NewAssertionError(reflect.TypeOf(newObj), event.NewObj()) + } + oldObj, ok := event.OldObj().(*meshresource.RPCInstanceResource) + if !ok && event.OldObj() != nil { + return bizerror.NewAssertionError(reflect.TypeOf(oldObj), event.OldObj()) + } + var processErr error + switch event.Type() { + case cache.Added, cache.Updated, cache.Replaced, cache.Sync: + if newObj == nil { + errStr := "process rpc instance upsert event, but new obj is nil, skipped processing" + logger.Errorf(errStr) + return bizerror.New(bizerror.EventError, errStr) + } + processErr = s.processUpsert(newObj) + case cache.Deleted: + if oldObj == nil { + errStr := "process rpc instance delete event, but old obj is nil, skipped processing" + logger.Errorf(errStr) + return bizerror.New(bizerror.EventError, errStr) + } + processErr = s.processDelete(oldObj) + } + if processErr != nil { + logger.Errorf("process rpc instance event cause: %s, event: %s", processErr.Error(), event.String()) + return processErr + } + logger.Infof("process rpc instance event successfully, event: %s", event.String()) + return nil +} + +func (s *RPCInstanceEventSubscriber) processUpsert(rpcInstanceRes *meshresource.RPCInstanceResource) error { + // If the conditions follow are not met, we cannot identify it as a dubbo instance, so we skip it + if !s.checkAttributeEnough(rpcInstanceRes) { + logger.Warnf("cannot identify rpc instance %s as a dubbo instance, skipped updating instance", rpcInstanceRes.Name) + return nil + } + instanceRes, err := s.getRelatedInstanceRes(rpcInstanceRes) + if err != nil { + return err + } + // if instance resource exists, that is to say the runtime instance exists and has been watched by engine + // We should merge the rpc info into it + if instanceRes != nil { + s.mergeRPCInstance(instanceRes, rpcInstanceRes) + return s.instanceStore.Update(instanceRes) + } + // Otherwise we can create a new instance resource by rpc instance + instanceRes = s.fromRPCInstance(rpcInstanceRes) + if err := s.instanceStore.Add(instanceRes); err != nil { + logger.Errorf("add instance resource failed, instance: %s, err: %s", instanceRes.ResourceKey(), err.Error()) + return err + } + instanceAddEvent := events.NewResourceChangedEvent(cache.Added, nil, instanceRes) + s.eventEmitter.Send(instanceAddEvent) + logger.Debugf("rpc instance upsert trigger instance add event, event: %s", instanceAddEvent.String()) + return nil +} + +func (s *RPCInstanceEventSubscriber) processDelete(rpcInstanceRes *meshresource.RPCInstanceResource) error { + if !s.checkAttributeEnough(rpcInstanceRes) { + logger.Warnf("cannot identify rpc instance %s as a dubbo instance, skipped deleting instance", rpcInstanceRes.Name) + return nil + } + instanceRes, err := s.getRelatedInstanceRes(rpcInstanceRes) + if err != nil { + return err + } + if instanceRes == nil { + logger.Warnf("cannot find instance resource for rpc instance %s, skipped deleting instance", rpcInstanceRes.Name) + return nil + } + if err := s.instanceStore.Delete(instanceRes); err != nil { + logger.Errorf("delete instance resource failed, instance: %s, err: %s", instanceRes.ResourceKey(), err.Error()) + return err + } + instanceDeleteEvent := events.NewResourceChangedEvent(cache.Deleted, instanceRes, nil) + s.eventEmitter.Send(instanceDeleteEvent) + logger.Debugf("rpc instance delete trigger instance delete event, event: %s", instanceDeleteEvent.String()) + return nil +} + +func (s *RPCInstanceEventSubscriber) checkAttributeEnough(rpcInstanceRes *meshresource.RPCInstanceResource) bool { + if rpcInstanceRes.Spec == nil || strutil.IsBlank(rpcInstanceRes.Spec.AppName) || + strutil.IsBlank(rpcInstanceRes.Spec.Ip) || rpcInstanceRes.Spec.Port <= 0 || + strutil.IsBlank(rpcInstanceRes.Mesh) || constants.DefaultMesh == rpcInstanceRes.Mesh { + return false + } + return true +} + +func (s *RPCInstanceEventSubscriber) mergeRPCInstance( + instanceRes *meshresource.InstanceResource, + rpcInstanceRes *meshresource.RPCInstanceResource) { + instanceRes.Spec.ReleaseVersion = rpcInstanceRes.Spec.ReleaseVersion + instanceRes.Spec.RegisterTime = rpcInstanceRes.Spec.RegisterTime + instanceRes.Spec.UnregisterTime = rpcInstanceRes.Spec.UnregisterTime + instanceRes.Spec.Protocol = rpcInstanceRes.Spec.Protocol + instanceRes.Spec.Serialization = rpcInstanceRes.Spec.Serialization + instanceRes.Spec.PreferSerialization = rpcInstanceRes.Spec.PreferSerialization + instanceRes.Spec.Tags = rpcInstanceRes.Spec.Tags +} + +func (s *RPCInstanceEventSubscriber) fromRPCInstance(rpcInstanceRes *meshresource.RPCInstanceResource) *meshresource.InstanceResource { + resName := meshresource.BuildInstanceResName(rpcInstanceRes.Spec.AppName, rpcInstanceRes.Spec.Ip, rpcInstanceRes.Spec.Port) + instanceRes := meshresource.NewInstanceResourceWithAttributes(resName, rpcInstanceRes.Mesh) + instanceRes.Spec.Name = rpcInstanceRes.Spec.Name + instanceRes.Spec.AppName = rpcInstanceRes.Spec.AppName + instanceRes.Spec.Ip = rpcInstanceRes.Spec.Ip + instanceRes.Spec.RpcPort = rpcInstanceRes.Spec.Port + s.mergeRPCInstance(instanceRes, rpcInstanceRes) + return instanceRes +} + +func (s *RPCInstanceEventSubscriber) getRelatedInstanceRes( + rpcInstanceRes *meshresource.RPCInstanceResource) (*meshresource.InstanceResource, error) { + instanceResName := meshresource.BuildInstanceResName(rpcInstanceRes.Spec.AppName, rpcInstanceRes.Spec.Ip, rpcInstanceRes.Spec.Port) + res, exists, err := s.instanceStore.GetByKey(coremodel.BuildResourceKey(rpcInstanceRes.Mesh, instanceResName)) + if err != nil { + return nil, err + } + if !exists { + return nil, nil + } + instanceRes, ok := res.(*meshresource.InstanceResource) + if !ok { + return nil, bizerror.NewAssertionError(meshresource.InstanceKind, reflect.TypeOf(res).Name()) + } + return instanceRes, nil +} diff --git a/pkg/core/engine/component.go b/pkg/core/engine/component.go index 783aa340c..bbf5bed80 100644 --- a/pkg/core/engine/component.go +++ b/pkg/core/engine/component.go @@ -128,7 +128,7 @@ func (e *engineComponent) initInformers(cfg *enginecfg.Config, emitter events.Em func (e *engineComponent) initSubscribers(eventbus events.EventBus) error { rs, err := e.storeRouter.ResourceKindRoute(meshresource.InstanceKind) if err != nil { - return fmt.Errorf("can not find store for resource kind %s, %w", meshresource.RuntimeInstanceKind, err) + return fmt.Errorf("can not find store for resource kind %s, %w", meshresource.InstanceKind, err) } runtimeInstanceSub := subscriber.NewRuntimeInstanceEventSubscriber(rs, eventbus) e.subscribers = append(e.subscribers, runtimeInstanceSub) diff --git a/pkg/core/engine/subscriber/runtime_instance.go b/pkg/core/engine/subscriber/runtime_instance.go index 212a114fd..50a065a0a 100644 --- a/pkg/core/engine/subscriber/runtime_instance.go +++ b/pkg/core/engine/subscriber/runtime_instance.go @@ -21,10 +21,13 @@ import ( "errors" "reflect" + "github.com/duke-git/lancet/v2/slice" "github.com/duke-git/lancet/v2/strutil" "k8s.io/client-go/tools/cache" "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" + enginecfg "github.com/apache/dubbo-admin/pkg/config/engine" "github.com/apache/dubbo-admin/pkg/core/events" "github.com/apache/dubbo-admin/pkg/core/logger" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" @@ -34,8 +37,15 @@ import ( ) type RuntimeInstanceEventSubscriber struct { - instanceResourceStore store.ResourceStore - eventEmitter events.Emitter + instanceStore store.ResourceStore + eventEmitter events.Emitter +} + +func NewRuntimeInstanceEventSubscriber(instanceResourceStore store.ResourceStore, emitter events.Emitter) events.Subscriber { + return &RuntimeInstanceEventSubscriber{ + instanceStore: instanceResourceStore, + eventEmitter: emitter, + } } func (s *RuntimeInstanceEventSubscriber) ResourceKind() coremodel.ResourceKind { @@ -48,11 +58,11 @@ func (s *RuntimeInstanceEventSubscriber) Name() string { func (s *RuntimeInstanceEventSubscriber) ProcessEvent(event events.Event) error { newObj, ok := event.NewObj().(*meshresource.RuntimeInstanceResource) - if !ok && newObj != nil { + if !ok && event.NewObj() != nil { return bizerror.NewAssertionError(meshresource.RuntimeInstanceKind, reflect.TypeOf(event.NewObj()).Name()) } oldObj, ok := event.OldObj().(*meshresource.RuntimeInstanceResource) - if !ok && oldObj != nil { + if !ok && event.OldObj() != nil { return bizerror.NewAssertionError(meshresource.RuntimeInstanceKind, reflect.TypeOf(event.OldObj()).Name()) } var processErr error @@ -72,84 +82,42 @@ func (s *RuntimeInstanceEventSubscriber) ProcessEvent(event events.Event) error } processErr = s.processDelete(oldObj) } - eventStr := event.String() - if processErr == nil { - logger.Infof("process runtime instance event successfully, event: %s", eventStr) - } else { - logger.Errorf("process runtime instance event failed, event: %s, err: %s", eventStr, processErr.Error()) - } - return processErr -} - -func (s *RuntimeInstanceEventSubscriber) getRelatedInstanceResource( - rtInstance *meshresource.RuntimeInstanceResource) (*meshresource.InstanceResource, error) { - resources, err := s.instanceResourceStore.ListByIndexes(map[string]string{ - index.ByInstanceIpIndex: rtInstance.Spec.Ip, - }) - if err != nil { - return nil, err - } - if len(resources) == 0 { - return nil, nil - } - instanceResources := make([]*meshresource.InstanceResource, len(resources)) - for i, item := range resources { - if res, ok := item.(*meshresource.InstanceResource); ok { - instanceResources[i] = res - } else { - return nil, bizerror.NewAssertionError("InstanceResource", reflect.TypeOf(item).Name()) - } + if processErr != nil { + logger.Errorf("process runtime instance event failed, cause: %s event: %s", processErr.Error(), event.String()) + return processErr } - return instanceResources[0], nil -} - -func (s *RuntimeInstanceEventSubscriber) mergeRuntimeInstance( - instanceRes *meshresource.InstanceResource, - rtInstanceRes *meshresource.RuntimeInstanceResource) { - instanceRes.Name = rtInstanceRes.Name - instanceRes.Spec.Name = rtInstanceRes.Spec.Name - instanceRes.Spec.Ip = rtInstanceRes.Spec.Ip - instanceRes.Labels = rtInstanceRes.Labels - instanceRes.Spec.Image = rtInstanceRes.Spec.Image - instanceRes.Spec.CreateTime = rtInstanceRes.Spec.CreateTime - instanceRes.Spec.StartTime = rtInstanceRes.Spec.StartTime - instanceRes.Spec.ReadyTime = rtInstanceRes.Spec.ReadyTime - instanceRes.Spec.DeployState = rtInstanceRes.Spec.Phase - instanceRes.Spec.WorkloadType = rtInstanceRes.Spec.WorkloadType - instanceRes.Spec.WorkloadName = rtInstanceRes.Spec.WorkloadName - instanceRes.Spec.Node = rtInstanceRes.Spec.Node - instanceRes.Spec.Probes = rtInstanceRes.Spec.Probes - instanceRes.Spec.Conditions = rtInstanceRes.Spec.Conditions -} - -func (s *RuntimeInstanceEventSubscriber) fromRuntimeInstance( - rtInstanceRes *meshresource.RuntimeInstanceResource) *meshresource.InstanceResource { - instanceRes := meshresource.NewInstanceResourceWithAttributes(rtInstanceRes.Name, rtInstanceRes.Mesh) - s.mergeRuntimeInstance(instanceRes, rtInstanceRes) - return instanceRes + logger.Infof("process runtime instance event successfully, event: %s", event.String()) + return nil } // processUpsert when runtime instance added or updated, we should add/update the corresponding instance resource func (s *RuntimeInstanceEventSubscriber) processUpsert(rtInstanceRes *meshresource.RuntimeInstanceResource) error { - instanceResource, err := s.getRelatedInstanceResource(rtInstanceRes) + var instanceResource *meshresource.InstanceResource + var err error + switch rtInstanceRes.Spec.SourceEngineType { + case string(enginecfg.Kubernetes): + instanceResource, err = s.getRelatedInstanceByIP(rtInstanceRes) + default: + instanceResource, err = s.getRelatedInstanceByName(rtInstanceRes) + } if err != nil { return err } - // If instance resource exists, the rpc instance resource exists in remote registry and has been watched by discovery. - // So we should merge the runtime info into it + // if instance resource exists, that is to say the rpc instance exists in remote registry and has been watched by discovery. + // so we should merge the runtime info into it if instanceResource != nil { s.mergeRuntimeInstance(instanceResource, rtInstanceRes) - return s.instanceResourceStore.Update(instanceResource) + return s.instanceStore.Update(instanceResource) } - // If instance resource does not exist, we should create a new instance resource by runtime instance - // If the app name is empty, we cannot identify it as a dubbo app, so we skip it - if strutil.IsBlank(rtInstanceRes.Spec.AppName) { - logger.Warnf("cannot identify runtime instance %s as a dubbo app, skipped updating instance", rtInstanceRes.Name) + // if instance resource does not exist, that is to say the rpc instance does not exist in remote registry. + // we need to check whether the runtime instance resource is enough to create a new instance resource + if !checkAttributesEnough(rtInstanceRes) { + logger.Warnf("cannot identify runtime instance %s to a dubbo instance, skipped creating new instance", rtInstanceRes.ResourceKey()) return nil } - // Otherwise we can create a new instance resource by runtime instance + // if conditions met, we should create a new instance resource by runtime instance instanceRes := s.fromRuntimeInstance(rtInstanceRes) - if err = s.instanceResourceStore.Add(instanceRes); err != nil { + if err = s.instanceStore.Add(instanceRes); err != nil { logger.Errorf("add instance resource failed, instance: %s, err: %s", instanceRes.ResourceKey(), err.Error()) return err } @@ -161,14 +129,22 @@ func (s *RuntimeInstanceEventSubscriber) processUpsert(rtInstanceRes *meshresour // processDelete when runtime instance deleted, we should delete the corresponding instance resource func (s *RuntimeInstanceEventSubscriber) processDelete(rtInstanceRes *meshresource.RuntimeInstanceResource) error { - instanceResource, err := s.getRelatedInstanceResource(rtInstanceRes) + var instanceResource *meshresource.InstanceResource + var err error + switch rtInstanceRes.Spec.SourceEngineType { + case string(enginecfg.Kubernetes): + instanceResource, err = s.getRelatedInstanceByIP(rtInstanceRes) + default: + instanceResource, err = s.getRelatedInstanceByName(rtInstanceRes) + } if err != nil { return err } if instanceResource == nil { + logger.Warnf("cannot find instance resource by runtime instance %s, skipped deleting instance", rtInstanceRes.ResourceKey()) return nil } - if err = s.instanceResourceStore.Delete(instanceResource.ResourceKey()); err != nil { + if err = s.instanceStore.Delete(instanceResource.ResourceKey()); err != nil { logger.Errorf("delete instance resource failed, instance: %s, err: %s", instanceResource.ResourceKey(), err.Error()) return err } @@ -178,9 +154,102 @@ func (s *RuntimeInstanceEventSubscriber) processDelete(rtInstanceRes *meshresour return nil } -func NewRuntimeInstanceEventSubscriber(instanceResourceStore store.ResourceStore, emitter events.Emitter) events.Subscriber { - return &RuntimeInstanceEventSubscriber{ - instanceResourceStore: instanceResourceStore, - eventEmitter: emitter, +func (s *RuntimeInstanceEventSubscriber) getRelatedInstanceByName( + rtInstanceRes *meshresource.RuntimeInstanceResource) (*meshresource.InstanceResource, error) { + if rtInstanceRes.Spec == nil || strutil.IsBlank(rtInstanceRes.Spec.AppName) || + strutil.IsBlank(rtInstanceRes.Spec.Ip) || rtInstanceRes.Spec.RpcPort <= 0 { + return nil, nil + } + instanceResName := meshresource.BuildInstanceResName(rtInstanceRes.Spec.AppName, rtInstanceRes.Spec.Ip, rtInstanceRes.Spec.RpcPort) + resources, err := s.instanceStore.ListByIndexes(map[string]string{ + index.ByInstanceNameIndex: instanceResName, + }) + if err != nil { + return nil, err + } + if len(resources) == 0 { + return nil, nil + } + instanceResList := make([]*meshresource.InstanceResource, len(resources)) + for i, item := range resources { + res, ok := item.(*meshresource.InstanceResource) + if !ok { + return nil, bizerror.NewAssertionError("InstanceResource", reflect.TypeOf(item).Name()) + } + instanceResList[i] = res + } + if len(instanceResList) > 1 { + resKeys := slice.Map(instanceResList, func(index int, item *meshresource.InstanceResource) string { + return item.ResourceKey() + }) + logger.Warnf("there are more than two instances which have the same name, instance keys: %s, name: %s", resKeys, instanceResName) + return nil, nil + } + return instanceResList[0], nil +} + +func (s *RuntimeInstanceEventSubscriber) getRelatedInstanceByIP( + rtInstanceRes *meshresource.RuntimeInstanceResource) (*meshresource.InstanceResource, error) { + resources, err := s.instanceStore.ListByIndexes(map[string]string{ + index.ByInstanceIpIndex: rtInstanceRes.Spec.Ip, + }) + if err != nil { + return nil, err + } + if len(resources) == 0 { + return nil, nil + } + instanceResList := make([]*meshresource.InstanceResource, len(resources)) + for i, item := range resources { + res, ok := item.(*meshresource.InstanceResource) + if !ok { + return nil, bizerror.NewAssertionError("InstanceResource", reflect.TypeOf(item).Name()) + } + instanceResList[i] = res + } + if len(instanceResList) > 1 { + resKeys := slice.Map(instanceResList, func(index int, item *meshresource.InstanceResource) string { + return item.ResourceKey() + }) + logger.Warnf("there are instances which have same ip, instance keys: %s, ip: %s", resKeys, rtInstanceRes.Spec.Ip) + return nil, nil + } + return instanceResList[0], nil +} + +func (s *RuntimeInstanceEventSubscriber) mergeRuntimeInstance( + instanceRes *meshresource.InstanceResource, + rtInstanceRes *meshresource.RuntimeInstanceResource) { + instanceRes.Labels = rtInstanceRes.Labels + instanceRes.Spec.Image = rtInstanceRes.Spec.Image + instanceRes.Spec.CreateTime = rtInstanceRes.Spec.CreateTime + instanceRes.Spec.StartTime = rtInstanceRes.Spec.StartTime + instanceRes.Spec.ReadyTime = rtInstanceRes.Spec.ReadyTime + instanceRes.Spec.DeployState = rtInstanceRes.Spec.Phase + instanceRes.Spec.WorkloadType = rtInstanceRes.Spec.WorkloadType + instanceRes.Spec.WorkloadName = rtInstanceRes.Spec.WorkloadName + instanceRes.Spec.Node = rtInstanceRes.Spec.Node + instanceRes.Spec.Probes = rtInstanceRes.Spec.Probes + instanceRes.Spec.Conditions = rtInstanceRes.Spec.Conditions +} + +func (s *RuntimeInstanceEventSubscriber) fromRuntimeInstance( + rtInstanceRes *meshresource.RuntimeInstanceResource) *meshresource.InstanceResource { + resName := meshresource.BuildInstanceResName(rtInstanceRes.Spec.AppName, rtInstanceRes.Spec.Ip, rtInstanceRes.Spec.RpcPort) + instanceRes := meshresource.NewInstanceResourceWithAttributes(resName, rtInstanceRes.Mesh) + instanceRes.Spec.Name = resName + instanceRes.Spec.AppName = rtInstanceRes.Spec.AppName + instanceRes.Spec.Ip = rtInstanceRes.Spec.Ip + instanceRes.Spec.RpcPort = rtInstanceRes.Spec.RpcPort + s.mergeRuntimeInstance(instanceRes, rtInstanceRes) + return instanceRes +} + +func checkAttributesEnough(rtInstanceRes *meshresource.RuntimeInstanceResource) bool { + if rtInstanceRes.Spec == nil || strutil.IsBlank(rtInstanceRes.Spec.AppName) || + strutil.IsBlank(rtInstanceRes.Spec.Ip) || rtInstanceRes.Spec.RpcPort <= 0 || + strutil.IsBlank(rtInstanceRes.Spec.Mesh) || constants.DefaultMesh == rtInstanceRes.Spec.Mesh { + return false } + return true } diff --git a/pkg/core/events/component.go b/pkg/core/events/component.go index 2e6bfc0f5..8cd5e492a 100644 --- a/pkg/core/events/component.go +++ b/pkg/core/events/component.go @@ -113,7 +113,7 @@ func (b *eventBus) Send(event Event) { for _, sub := range subs { // TODO Do we need to support reprocess if err := sub.ProcessEvent(event); err != nil { - logger.Errorf("failed to process event in %s , skipped, event: %v", sub.Name(), event) + logger.Errorf("failed to process event in %s, cause: %s, event: %v", sub.Name(), err.Error(), event) } } } diff --git a/pkg/core/events/eventbus.go b/pkg/core/events/eventbus.go index 552d1f479..c0fe63bf1 100644 --- a/pkg/core/events/eventbus.go +++ b/pkg/core/events/eventbus.go @@ -33,6 +33,8 @@ type Event interface { OldObj() model.Resource // NewObj returns the new object, nil if event type is in [cache.Deleted] NewObj() model.Resource + // Context returns the context of the event, if event provider want to pass extra info to the consumer, just use context + Context() map[string]string // String returns the string representation of the event String() string } @@ -48,18 +50,30 @@ type Subscriber interface { type Subscribers []Subscriber type ResourceChangedEvent struct { - typ cache.DeltaType - oldObj model.Resource - newObj model.Resource + typ cache.DeltaType + oldObj model.Resource + newObj model.Resource + context map[string]string } var _ Event = &ResourceChangedEvent{} func NewResourceChangedEvent(typ cache.DeltaType, oldObj model.Resource, newObj model.Resource) *ResourceChangedEvent { return &ResourceChangedEvent{ - typ: typ, - oldObj: oldObj, - newObj: newObj, + typ: typ, + oldObj: oldObj, + newObj: newObj, + context: map[string]string{}, + } +} + +func NewResourceChangedEventWithContext(typ cache.DeltaType, oldObj model.Resource, + newObj model.Resource, ctx map[string]string) *ResourceChangedEvent { + return &ResourceChangedEvent{ + typ: typ, + oldObj: oldObj, + newObj: newObj, + context: ctx, } } @@ -75,6 +89,10 @@ func (e *ResourceChangedEvent) NewObj() model.Resource { return e.newObj } +func (e *ResourceChangedEvent) Context() map[string]string { + return e.context +} + func (e *ResourceChangedEvent) String() string { return fmt.Sprintf("[type]: %s, [oldObj]: %s, [newObj]: %s", e.typ, convertor.ToString(e.oldObj), convertor.ToString(e.newObj)) diff --git a/pkg/core/logger/log.go b/pkg/core/logger/log.go index 8794ed01f..59c538cce 100644 --- a/pkg/core/logger/log.go +++ b/pkg/core/logger/log.go @@ -36,8 +36,8 @@ var ( NameKey: "logger", FunctionKey: "", StacktraceKey: "stacktrace", - EncodeLevel: zapcore.CapitalLevelEncoder, - EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05"), + EncodeLevel: zapcore.CapitalColorLevelEncoder, + EncodeTime: zapcore.RFC3339TimeEncoder, EncodeCaller: zapcore.ShortCallerEncoder, EncodeDuration: zapcore.SecondsDurationEncoder, }) @@ -73,8 +73,11 @@ func Init() { defer logger.Sync() // flushes buffer, if any sugar = logger.Sugar() + // Create a separate logger for gRPC with higher log level to suppress INFO logs + grpcCore := zapcore.NewCore(encoder, os.Stdout, zap.WarnLevel) + grpcLogger := zap.New(grpcCore, zap.AddCaller(), zap.AddCallerSkip(2)) // Make sure that log statements internal to gRPC library are logged using the zapLogger as well. - grpcZap.ReplaceGrpcLoggerV2(logger) + grpcZap.ReplaceGrpcLoggerV2(grpcLogger) } // nolint diff --git a/pkg/core/resource/apis/mesh/v1alpha1/affinityroute_types.go b/pkg/core/resource/apis/mesh/v1alpha1/affinityroute_types.go index 46fa116b7..ad810110d 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/affinityroute_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/affinityroute_types.go @@ -58,12 +58,6 @@ type AffinityRouteResourceStatus struct { // define resource-specific status here } -type AffinityRouteResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AffinityRouteResource `json:"items"` -} - func (r *AffinityRouteResource) ResourceKind() coremodel.ResourceKind { return AffinityRouteKind } @@ -83,11 +77,8 @@ func (r *AffinityRouteResource) ResourceMeta() metav1.ObjectMeta { func (r *AffinityRouteResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *AffinityRouteResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *AffinityRouteResource) DeepCopyObject() k8sruntime.Object { out := &AffinityRouteResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *AffinityRouteResource) DeepCopyObject() k8sruntime.Object { func (r *AffinityRouteResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode AffinityRouteResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode AffinityRouteResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewAffinityRouteResourceWithAttributes(name string, mesh string) *AffinityR Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.AffinityRoute{}, } } @@ -137,5 +129,37 @@ func NewAffinityRouteResource() coremodel.Resource { Kind: string(AffinityRouteKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.AffinityRoute{}, + } +} + +type AffinityRouteResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AffinityRouteResource `json:"items"` +} + +func (r *AffinityRouteResourceList) DeepCopyObject() k8sruntime.Object { + out := &AffinityRouteResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]AffinityRouteResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*AffinityRouteResource) + } + return out +} + +func NewAffinityRouteResourceList() *AffinityRouteResourceList { + return &AffinityRouteResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(AffinityRouteKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/application_types.go b/pkg/core/resource/apis/mesh/v1alpha1/application_types.go index 8fb5e9bb1..b10a5fe84 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/application_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/application_types.go @@ -58,12 +58,6 @@ type ApplicationResourceStatus struct { // define resource-specific status here } -type ApplicationResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ApplicationResource `json:"items"` -} - func (r *ApplicationResource) ResourceKind() coremodel.ResourceKind { return ApplicationKind } @@ -83,11 +77,8 @@ func (r *ApplicationResource) ResourceMeta() metav1.ObjectMeta { func (r *ApplicationResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *ApplicationResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *ApplicationResource) DeepCopyObject() k8sruntime.Object { out := &ApplicationResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *ApplicationResource) DeepCopyObject() k8sruntime.Object { func (r *ApplicationResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode ApplicationResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode ApplicationResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewApplicationResourceWithAttributes(name string, mesh string) *Application Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.Application{}, } } @@ -137,5 +129,37 @@ func NewApplicationResource() coremodel.Resource { Kind: string(ApplicationKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.Application{}, + } +} + +type ApplicationResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ApplicationResource `json:"items"` +} + +func (r *ApplicationResourceList) DeepCopyObject() k8sruntime.Object { + out := &ApplicationResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]ApplicationResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*ApplicationResource) + } + return out +} + +func NewApplicationResourceList() *ApplicationResourceList { + return &ApplicationResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ApplicationKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/conditionroute_types.go b/pkg/core/resource/apis/mesh/v1alpha1/conditionroute_types.go index 27260d2ce..ef486e813 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/conditionroute_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/conditionroute_types.go @@ -58,12 +58,6 @@ type ConditionRouteResourceStatus struct { // define resource-specific status here } -type ConditionRouteResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ConditionRouteResource `json:"items"` -} - func (r *ConditionRouteResource) ResourceKind() coremodel.ResourceKind { return ConditionRouteKind } @@ -83,11 +77,8 @@ func (r *ConditionRouteResource) ResourceMeta() metav1.ObjectMeta { func (r *ConditionRouteResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *ConditionRouteResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *ConditionRouteResource) DeepCopyObject() k8sruntime.Object { out := &ConditionRouteResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *ConditionRouteResource) DeepCopyObject() k8sruntime.Object { func (r *ConditionRouteResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode ConditionRouteResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode ConditionRouteResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewConditionRouteResourceWithAttributes(name string, mesh string) *Conditio Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.ConditionRoute{}, } } @@ -137,5 +129,37 @@ func NewConditionRouteResource() coremodel.Resource { Kind: string(ConditionRouteKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.ConditionRoute{}, + } +} + +type ConditionRouteResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ConditionRouteResource `json:"items"` +} + +func (r *ConditionRouteResourceList) DeepCopyObject() k8sruntime.Object { + out := &ConditionRouteResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]ConditionRouteResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*ConditionRouteResource) + } + return out +} + +func NewConditionRouteResourceList() *ConditionRouteResourceList { + return &ConditionRouteResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ConditionRouteKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/dynamicconfig_types.go b/pkg/core/resource/apis/mesh/v1alpha1/dynamicconfig_types.go index ab6766e5f..ebd9f5c9b 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/dynamicconfig_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/dynamicconfig_types.go @@ -58,12 +58,6 @@ type DynamicConfigResourceStatus struct { // define resource-specific status here } -type DynamicConfigResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DynamicConfigResource `json:"items"` -} - func (r *DynamicConfigResource) ResourceKind() coremodel.ResourceKind { return DynamicConfigKind } @@ -83,11 +77,8 @@ func (r *DynamicConfigResource) ResourceMeta() metav1.ObjectMeta { func (r *DynamicConfigResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *DynamicConfigResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *DynamicConfigResource) DeepCopyObject() k8sruntime.Object { out := &DynamicConfigResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *DynamicConfigResource) DeepCopyObject() k8sruntime.Object { func (r *DynamicConfigResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode DynamicConfigResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode DynamicConfigResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewDynamicConfigResourceWithAttributes(name string, mesh string) *DynamicCo Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.DynamicConfig{}, } } @@ -137,5 +129,37 @@ func NewDynamicConfigResource() coremodel.Resource { Kind: string(DynamicConfigKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.DynamicConfig{}, + } +} + +type DynamicConfigResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DynamicConfigResource `json:"items"` +} + +func (r *DynamicConfigResourceList) DeepCopyObject() k8sruntime.Object { + out := &DynamicConfigResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]DynamicConfigResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*DynamicConfigResource) + } + return out +} + +func NewDynamicConfigResourceList() *DynamicConfigResourceList { + return &DynamicConfigResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(DynamicConfigKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go b/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go new file mode 100644 index 000000000..0377c5657 --- /dev/null +++ b/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package v1alpha1 + +import ( + "fmt" +) + +func BuildInstanceResName(appName string, ip string, rpcProt int64) string { + return fmt.Sprintf("%s%s:%d", appName, ip, rpcProt) +} diff --git a/pkg/core/resource/apis/mesh/v1alpha1/instance_types.go b/pkg/core/resource/apis/mesh/v1alpha1/instance_types.go index 3c451db6b..7777e875c 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/instance_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/instance_types.go @@ -58,12 +58,6 @@ type InstanceResourceStatus struct { // define resource-specific status here } -type InstanceResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []InstanceResource `json:"items"` -} - func (r *InstanceResource) ResourceKind() coremodel.ResourceKind { return InstanceKind } @@ -83,11 +77,8 @@ func (r *InstanceResource) ResourceMeta() metav1.ObjectMeta { func (r *InstanceResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *InstanceResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *InstanceResource) DeepCopyObject() k8sruntime.Object { out := &InstanceResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *InstanceResource) DeepCopyObject() k8sruntime.Object { func (r *InstanceResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode InstanceResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode InstanceResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewInstanceResourceWithAttributes(name string, mesh string) *InstanceResour Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.Instance{}, } } @@ -137,5 +129,37 @@ func NewInstanceResource() coremodel.Resource { Kind: string(InstanceKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.Instance{}, + } +} + +type InstanceResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []InstanceResource `json:"items"` +} + +func (r *InstanceResourceList) DeepCopyObject() k8sruntime.Object { + out := &InstanceResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]InstanceResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*InstanceResource) + } + return out +} + +func NewInstanceResourceList() *InstanceResourceList { + return &InstanceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(InstanceKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/rpcinstance_types.go b/pkg/core/resource/apis/mesh/v1alpha1/rpcinstance_types.go index 064d77453..6cec8dd6f 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/rpcinstance_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/rpcinstance_types.go @@ -58,12 +58,6 @@ type RPCInstanceResourceStatus struct { // define resource-specific status here } -type RPCInstanceResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []RPCInstanceResource `json:"items"` -} - func (r *RPCInstanceResource) ResourceKind() coremodel.ResourceKind { return RPCInstanceKind } @@ -83,11 +77,8 @@ func (r *RPCInstanceResource) ResourceMeta() metav1.ObjectMeta { func (r *RPCInstanceResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *RPCInstanceResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *RPCInstanceResource) DeepCopyObject() k8sruntime.Object { out := &RPCInstanceResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *RPCInstanceResource) DeepCopyObject() k8sruntime.Object { func (r *RPCInstanceResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode RPCInstanceResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode RPCInstanceResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewRPCInstanceResourceWithAttributes(name string, mesh string) *RPCInstance Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.RPCInstance{}, } } @@ -137,5 +129,37 @@ func NewRPCInstanceResource() coremodel.Resource { Kind: string(RPCInstanceKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.RPCInstance{}, + } +} + +type RPCInstanceResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []RPCInstanceResource `json:"items"` +} + +func (r *RPCInstanceResourceList) DeepCopyObject() k8sruntime.Object { + out := &RPCInstanceResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]RPCInstanceResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*RPCInstanceResource) + } + return out +} + +func NewRPCInstanceResourceList() *RPCInstanceResourceList { + return &RPCInstanceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(RPCInstanceKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/rpcinstancemetadata_types.go b/pkg/core/resource/apis/mesh/v1alpha1/rpcinstancemetadata_types.go index c0e738266..d472e2de5 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/rpcinstancemetadata_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/rpcinstancemetadata_types.go @@ -58,12 +58,6 @@ type RPCInstanceMetadataResourceStatus struct { // define resource-specific status here } -type RPCInstanceMetadataResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []RPCInstanceMetadataResource `json:"items"` -} - func (r *RPCInstanceMetadataResource) ResourceKind() coremodel.ResourceKind { return RPCInstanceMetadataKind } @@ -83,11 +77,8 @@ func (r *RPCInstanceMetadataResource) ResourceMeta() metav1.ObjectMeta { func (r *RPCInstanceMetadataResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *RPCInstanceMetadataResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *RPCInstanceMetadataResource) DeepCopyObject() k8sruntime.Object { out := &RPCInstanceMetadataResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -128,6 +119,7 @@ func NewRPCInstanceMetadataResourceWithAttributes(name string, mesh string) *RPC Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.RPCInstanceMetadata{}, } } @@ -137,5 +129,37 @@ func NewRPCInstanceMetadataResource() coremodel.Resource { Kind: string(RPCInstanceMetadataKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.RPCInstanceMetadata{}, + } +} + +type RPCInstanceMetadataResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []RPCInstanceMetadataResource `json:"items"` +} + +func (r *RPCInstanceMetadataResourceList) DeepCopyObject() k8sruntime.Object { + out := &RPCInstanceMetadataResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]RPCInstanceMetadataResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*RPCInstanceMetadataResource) + } + return out +} + +func NewRPCInstanceMetadataResourceList() *RPCInstanceMetadataResourceList { + return &RPCInstanceMetadataResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(RPCInstanceMetadataKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/runtimeinstance_types.go b/pkg/core/resource/apis/mesh/v1alpha1/runtimeinstance_types.go index 113c89719..072425793 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/runtimeinstance_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/runtimeinstance_types.go @@ -58,12 +58,6 @@ type RuntimeInstanceResourceStatus struct { // define resource-specific status here } -type RuntimeInstanceResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []RuntimeInstanceResource `json:"items"` -} - func (r *RuntimeInstanceResource) ResourceKind() coremodel.ResourceKind { return RuntimeInstanceKind } @@ -83,11 +77,8 @@ func (r *RuntimeInstanceResource) ResourceMeta() metav1.ObjectMeta { func (r *RuntimeInstanceResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *RuntimeInstanceResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *RuntimeInstanceResource) DeepCopyObject() k8sruntime.Object { out := &RuntimeInstanceResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *RuntimeInstanceResource) DeepCopyObject() k8sruntime.Object { func (r *RuntimeInstanceResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode RuntimeInstanceResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode RuntimeInstanceResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewRuntimeInstanceResourceWithAttributes(name string, mesh string) *Runtime Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.RuntimeInstance{}, } } @@ -137,5 +129,37 @@ func NewRuntimeInstanceResource() coremodel.Resource { Kind: string(RuntimeInstanceKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.RuntimeInstance{}, + } +} + +type RuntimeInstanceResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []RuntimeInstanceResource `json:"items"` +} + +func (r *RuntimeInstanceResourceList) DeepCopyObject() k8sruntime.Object { + out := &RuntimeInstanceResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]RuntimeInstanceResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*RuntimeInstanceResource) + } + return out +} + +func NewRuntimeInstanceResourceList() *RuntimeInstanceResourceList { + return &RuntimeInstanceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(RuntimeInstanceKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/service_types.go b/pkg/core/resource/apis/mesh/v1alpha1/service_types.go index a18e6a4a9..2e42bdb94 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/service_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/service_types.go @@ -58,12 +58,6 @@ type ServiceResourceStatus struct { // define resource-specific status here } -type ServiceResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceResource `json:"items"` -} - func (r *ServiceResource) ResourceKind() coremodel.ResourceKind { return ServiceKind } @@ -83,11 +77,8 @@ func (r *ServiceResource) ResourceMeta() metav1.ObjectMeta { func (r *ServiceResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *ServiceResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *ServiceResource) DeepCopyObject() k8sruntime.Object { out := &ServiceResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *ServiceResource) DeepCopyObject() k8sruntime.Object { func (r *ServiceResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode ServiceResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode ServiceResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewServiceResourceWithAttributes(name string, mesh string) *ServiceResource Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.Service{}, } } @@ -137,5 +129,37 @@ func NewServiceResource() coremodel.Resource { Kind: string(ServiceKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.Service{}, + } +} + +type ServiceResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceResource `json:"items"` +} + +func (r *ServiceResourceList) DeepCopyObject() k8sruntime.Object { + out := &ServiceResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]ServiceResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*ServiceResource) + } + return out +} + +func NewServiceResourceList() *ServiceResourceList { + return &ServiceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ServiceKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/serviceconsumermetadata_types.go b/pkg/core/resource/apis/mesh/v1alpha1/serviceconsumermetadata_types.go index ef64a62f7..e63d1e0d8 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/serviceconsumermetadata_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/serviceconsumermetadata_types.go @@ -58,12 +58,6 @@ type ServiceConsumerMetadataResourceStatus struct { // define resource-specific status here } -type ServiceConsumerMetadataResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceConsumerMetadataResource `json:"items"` -} - func (r *ServiceConsumerMetadataResource) ResourceKind() coremodel.ResourceKind { return ServiceConsumerMetadataKind } @@ -83,11 +77,8 @@ func (r *ServiceConsumerMetadataResource) ResourceMeta() metav1.ObjectMeta { func (r *ServiceConsumerMetadataResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *ServiceConsumerMetadataResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *ServiceConsumerMetadataResource) DeepCopyObject() k8sruntime.Object { out := &ServiceConsumerMetadataResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *ServiceConsumerMetadataResource) DeepCopyObject() k8sruntime.Object { func (r *ServiceConsumerMetadataResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode ServiceConsumerMetadataResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode ServiceConsumerMetadataResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewServiceConsumerMetadataResourceWithAttributes(name string, mesh string) Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.ServiceConsumerMetadata{}, } } @@ -137,5 +129,37 @@ func NewServiceConsumerMetadataResource() coremodel.Resource { Kind: string(ServiceConsumerMetadataKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.ServiceConsumerMetadata{}, + } +} + +type ServiceConsumerMetadataResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceConsumerMetadataResource `json:"items"` +} + +func (r *ServiceConsumerMetadataResourceList) DeepCopyObject() k8sruntime.Object { + out := &ServiceConsumerMetadataResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]ServiceConsumerMetadataResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*ServiceConsumerMetadataResource) + } + return out +} + +func NewServiceConsumerMetadataResourceList() *ServiceConsumerMetadataResourceList { + return &ServiceConsumerMetadataResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ServiceConsumerMetadataKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermapping_types.go b/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermapping_types.go index 389ae8b1e..6392fc087 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermapping_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermapping_types.go @@ -58,12 +58,6 @@ type ServiceProviderMappingResourceStatus struct { // define resource-specific status here } -type ServiceProviderMappingResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceProviderMappingResource `json:"items"` -} - func (r *ServiceProviderMappingResource) ResourceKind() coremodel.ResourceKind { return ServiceProviderMappingKind } @@ -83,11 +77,8 @@ func (r *ServiceProviderMappingResource) ResourceMeta() metav1.ObjectMeta { func (r *ServiceProviderMappingResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *ServiceProviderMappingResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *ServiceProviderMappingResource) DeepCopyObject() k8sruntime.Object { out := &ServiceProviderMappingResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *ServiceProviderMappingResource) DeepCopyObject() k8sruntime.Object { func (r *ServiceProviderMappingResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode ServiceProviderMappingResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode ServiceProviderMappingResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewServiceProviderMappingResourceWithAttributes(name string, mesh string) * Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.ServiceProviderMapping{}, } } @@ -137,5 +129,37 @@ func NewServiceProviderMappingResource() coremodel.Resource { Kind: string(ServiceProviderMappingKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.ServiceProviderMapping{}, + } +} + +type ServiceProviderMappingResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceProviderMappingResource `json:"items"` +} + +func (r *ServiceProviderMappingResourceList) DeepCopyObject() k8sruntime.Object { + out := &ServiceProviderMappingResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]ServiceProviderMappingResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*ServiceProviderMappingResource) + } + return out +} + +func NewServiceProviderMappingResourceList() *ServiceProviderMappingResourceList { + return &ServiceProviderMappingResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ServiceProviderMappingKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermetadata_types.go b/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermetadata_types.go index e0e973159..397b6404f 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermetadata_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermetadata_types.go @@ -58,12 +58,6 @@ type ServiceProviderMetadataResourceStatus struct { // define resource-specific status here } -type ServiceProviderMetadataResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceProviderMetadataResource `json:"items"` -} - func (r *ServiceProviderMetadataResource) ResourceKind() coremodel.ResourceKind { return ServiceProviderMetadataKind } @@ -83,11 +77,8 @@ func (r *ServiceProviderMetadataResource) ResourceMeta() metav1.ObjectMeta { func (r *ServiceProviderMetadataResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *ServiceProviderMetadataResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *ServiceProviderMetadataResource) DeepCopyObject() k8sruntime.Object { out := &ServiceProviderMetadataResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *ServiceProviderMetadataResource) DeepCopyObject() k8sruntime.Object { func (r *ServiceProviderMetadataResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode ServiceProviderMetadataResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode ServiceProviderMetadataResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewServiceProviderMetadataResourceWithAttributes(name string, mesh string) Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.ServiceProviderMetadata{}, } } @@ -137,5 +129,37 @@ func NewServiceProviderMetadataResource() coremodel.Resource { Kind: string(ServiceProviderMetadataKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.ServiceProviderMetadata{}, + } +} + +type ServiceProviderMetadataResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceProviderMetadataResource `json:"items"` +} + +func (r *ServiceProviderMetadataResourceList) DeepCopyObject() k8sruntime.Object { + out := &ServiceProviderMetadataResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]ServiceProviderMetadataResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*ServiceProviderMetadataResource) + } + return out +} + +func NewServiceProviderMetadataResourceList() *ServiceProviderMetadataResourceList { + return &ServiceProviderMetadataResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ServiceProviderMetadataKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/tagroute_types.go b/pkg/core/resource/apis/mesh/v1alpha1/tagroute_types.go index 741f3af2f..45bd021b2 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/tagroute_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/tagroute_types.go @@ -58,12 +58,6 @@ type TagRouteResourceStatus struct { // define resource-specific status here } -type TagRouteResourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []TagRouteResource `json:"items"` -} - func (r *TagRouteResource) ResourceKind() coremodel.ResourceKind { return TagRouteKind } @@ -83,11 +77,8 @@ func (r *TagRouteResource) ResourceMeta() metav1.ObjectMeta { func (r *TagRouteResource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *TagRouteResource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *TagRouteResource) DeepCopyObject() k8sruntime.Object { out := &TagRouteResource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -111,7 +102,7 @@ func (r *TagRouteResource) DeepCopyObject() k8sruntime.Object { func (r *TagRouteResource) String() string { jsonStr, err := json.Marshal(r) if err != nil { - logger.Errorf("failed to encode TagRouteResource: %s to json, err: %s", r.ResourceKey(), err) + logger.Errorf("failed to encode TagRouteResource: %s to json, err: %w", r.ResourceKey(), err) return "" } return string(jsonStr) @@ -128,6 +119,7 @@ func NewTagRouteResourceWithAttributes(name string, mesh string) *TagRouteResour Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.TagRoute{}, } } @@ -137,5 +129,37 @@ func NewTagRouteResource() coremodel.Resource { Kind: string(TagRouteKind), APIVersion: "v1alpha1", }, + Spec: &meshproto.TagRoute{}, + } +} + +type TagRouteResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []TagRouteResource `json:"items"` +} + +func (r *TagRouteResourceList) DeepCopyObject() k8sruntime.Object { + out := &TagRouteResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]TagRouteResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*TagRouteResource) + } + return out +} + +func NewTagRouteResourceList() *TagRouteResourceList { + return &TagRouteResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(TagRouteKind), + APIVersion: "v1alpha1", + }, } } diff --git a/pkg/core/store/index/instance.go b/pkg/core/store/index/instance.go index f0bbd3fdf..ff19bf38c 100644 --- a/pkg/core/store/index/instance.go +++ b/pkg/core/store/index/instance.go @@ -20,6 +20,7 @@ package index import ( "reflect" + "github.com/duke-git/lancet/v2/strutil" "k8s.io/client-go/tools/cache" "github.com/apache/dubbo-admin/pkg/common/bizerror" @@ -29,12 +30,14 @@ import ( const ( ByInstanceAppNameIndex = "idx_instance_app_name" ByInstanceIpIndex = "idx_instance_ip" + ByInstanceNameIndex = "idx_instance_name" ) func init() { RegisterIndexers(meshresource.InstanceKind, map[string]cache.IndexFunc{ ByInstanceAppNameIndex: byInstanceAppName, ByInstanceIpIndex: byIp, + ByInstanceNameIndex: byInstanceName, }) } @@ -43,7 +46,7 @@ func byInstanceAppName(obj interface{}) ([]string, error) { if !ok { return nil, bizerror.NewAssertionError(meshresource.InstanceKind, reflect.TypeOf(obj).Name()) } - if instance.Spec == nil { + if instance.Spec == nil || strutil.IsBlank(instance.Spec.AppName) { return []string{}, nil } return []string{instance.Spec.AppName}, nil @@ -54,8 +57,19 @@ func byIp(obj interface{}) ([]string, error) { if !ok { return nil, bizerror.NewAssertionError(meshresource.InstanceKind, reflect.TypeOf(obj).Name()) } - if instance.Spec == nil { + if instance.Spec == nil || strutil.IsBlank(instance.Spec.Ip) { return []string{}, nil } return []string{instance.Spec.Ip}, nil } + +func byInstanceName(obj interface{}) ([]string, error) { + instance, ok := obj.(*meshresource.InstanceResource) + if !ok { + return nil, bizerror.NewAssertionError(meshresource.InstanceKind, reflect.TypeOf(obj).Name()) + } + if instance.Spec == nil || strutil.IsBlank(instance.Spec.Name) { + return []string{}, nil + } + return []string{instance.Spec.Name}, nil +} diff --git a/pkg/discovery/nacos2/factory.go b/pkg/discovery/nacos2/factory.go new file mode 100644 index 000000000..a76349207 --- /dev/null +++ b/pkg/discovery/nacos2/factory.go @@ -0,0 +1,71 @@ +package dubbogo + +import ( + "fmt" + + dubbogocom "dubbo.apache.org/dubbo-go/v3/common" + dubbogoconstant "dubbo.apache.org/dubbo-go/v3/common/constant" + dubbogonacos "dubbo.apache.org/dubbo-go/v3/remoting/nacos" + nacosconfigclient "github.com/nacos-group/nacos-sdk-go/v2/clients/config_client" + nacosnamingclient "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client" + + "github.com/apache/dubbo-admin/pkg/common/bizerror" + discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" + "github.com/apache/dubbo-admin/pkg/core/controller" + "github.com/apache/dubbo-admin/pkg/core/discovery" + "github.com/apache/dubbo-admin/pkg/discovery/nacos2/listerwatcher" +) + +func init() { + discovery.RegisterListWatcherFactory(&Factory{}) +} + +type Factory struct{} + +func (f *Factory) Support(d discoverycfg.Type) bool { + return d == discoverycfg.Nacos2 +} + +func (f *Factory) NewListWatchers(cfg *discoverycfg.Config) ([]controller.ResourceListerWatcher, error) { + nacosConfigClient, namingClient, err := f.initNacosClients(cfg) + if err != nil { + return nil, err + } + mappingLW := listerwatcher.NewMappingListerWatcher(cfg, nacosConfigClient) + serviceProviderMetadataLW := listerwatcher.NewServiceProviderMetadataListerWatcher(cfg, nacosConfigClient) + serviceConsumerMetadataLW := listerwatcher.NewServiceConsumerMetadataListerWatcher(cfg, namingClient) + rpcInstanceLW := listerwatcher.NewRPCInstanceListerWatcher(cfg, namingClient) + + return []controller.ResourceListerWatcher{ + mappingLW, + serviceProviderMetadataLW, + serviceConsumerMetadataLW, + rpcInstanceLW, + }, nil +} + +func (f *Factory) initNacosClients( + cfg *discoverycfg.Config, +) (nacosconfigclient.IConfigClient, nacosnamingclient.INamingClient, error) { + cfgCenterUrl, err := dubbogocom.NewURL(cfg.Address.ConfigCenter) + if err != nil { + return nil, nil, err + } + cfgCenterUrl.AddParam(dubbogoconstant.ClientNameKey, cfg.Name) + nacosConfigClient, err := dubbogonacos.NewNacosConfigClientByUrl(cfgCenterUrl) + if err != nil { + return nil, nil, bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("cannot create nacos config client for %s %s", cfg.Name, cfg.Address)) + } + registryUrl, err := dubbogocom.NewURL(cfg.Address.Registry) + if err != nil { + return nil, nil, err + } + registryUrl.AddParam(dubbogoconstant.ClientNameKey, cfg.Name) + namingClient, err := dubbogonacos.NewNacosClientByURL(registryUrl) + if err != nil { + return nil, nil, bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("cannot create nacos naming client for %s %s", cfg.Name, cfg.Address)) + } + return nacosConfigClient.Client(), namingClient.Client(), nil +} diff --git a/pkg/discovery/nacos2/listerwatcher/mapping.go b/pkg/discovery/nacos2/listerwatcher/mapping.go new file mode 100644 index 000000000..2f60023df --- /dev/null +++ b/pkg/discovery/nacos2/listerwatcher/mapping.go @@ -0,0 +1,188 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package listerwatcher + +import ( + "fmt" + "strings" + "time" + + "github.com/duke-git/lancet/v2/convertor" + "github.com/duke-git/lancet/v2/slice" + "github.com/go-co-op/gocron" + nacosconfigclient "github.com/nacos-group/nacos-sdk-go/v2/clients/config_client" + nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" + nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" + + meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" + discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" +) + +const Mapping = "mapping" + +type MappingListerWatcher struct { + cfg *discoverycfg.Config + configClient nacosconfigclient.IConfigClient + resultChan chan watch.Event + scheduler *gocron.Scheduler + stopWatch bool +} + +func NewMappingListerWatcher( + cfg *discoverycfg.Config, + configClient nacosconfigclient.IConfigClient, +) *MappingListerWatcher { + return &MappingListerWatcher{ + cfg: cfg, + configClient: configClient, + resultChan: make(chan watch.Event), + scheduler: gocron.NewScheduler(time.UTC), + stopWatch: false, + } +} + +func (lw *MappingListerWatcher) List(_ metav1.ListOptions) (k8sruntime.Object, error) { + resList := meshresource.NewServiceProviderMappingResourceList() + mappingResources, err := lw.fetchAllMappings() + if err != nil { + return nil, err + } + resList.Items = mappingResources + return resList, nil +} + +func (lw *MappingListerWatcher) Watch(_ metav1.ListOptions) (watch.Interface, error) { + _, err := lw.scheduler.Every(lw.cfg.Properties.ConfigWatchPeriod).Seconds().Do(func() { + if lw.stopWatch { + logger.Debugf("stop watching mappings") + lw.scheduler.Stop() + } + startTime := time.Now() + logger.Debugf("start fetching all mappings in nacos %s at %s", lw.cfg.Address.MetadataReport, startTime) + mappingResources, err := lw.fetchAllMappings() + if err != nil { + logger.Errorf("fetch all mappings in nacos %s failed, cause: %s", lw.cfg.Address.MetadataReport, err.Error()) + return + } + costs := time.Now().UnixMilli() - startTime.UnixMilli() + logger.Debugf("fetched all mappings in nacos %s, costs %dms", lw.cfg.Address.MetadataReport, costs) + slice.ForEach(mappingResources, func(index int, item meshresource.ServiceProviderMappingResource) { + lw.resultChan <- watch.Event{ + Type: watch.Modified, + Object: &item, + } + }) + }) + if err != nil { + return nil, bizerror.Wrap(err, bizerror.UnknownError, + fmt.Sprintf("fetch all mappings of nacos %s in a schedule occurs error", lw.cfg.Address.MetadataReport)) + } + lw.scheduler.StartAsync() + return lw, nil +} + +func (lw *MappingListerWatcher) fetchAllMappings() ([]meshresource.ServiceProviderMappingResource, error) { + listPage := func(pageNum int, pageSize int) (*nacosmodel.ConfigPage, error) { + configPage, err := lw.configClient.SearchConfig(nacosvo.SearchConfigParam{ + Search: "accurate", + Group: Mapping, + PageNo: pageNum, + PageSize: pageSize, + }) + if err != nil { + errMsg := fmt.Sprintf("cannot do page list of config, page size %d, page num %d, nacos address %s", + pageSize, pageNum, lw.cfg.Address.MetadataReport) + return nil, bizerror.Wrap(err, bizerror.NacosError, errMsg) + } + logger.Debugf("list config page, page size %d, page num %d, nacos address %s, total count %d, items %s", + pageSize, pageNum, lw.cfg.Address.MetadataReport, configPage.TotalCount, convertor.ToString(configPage.PageItems)) + return configPage, nil + } + mappingResourceList := make([]meshresource.ServiceProviderMappingResource, 0) + pageNum := 1 + pageSize := 50 + // list all mappings by page search + for { + configPage, err := listPage(pageNum, pageSize) + if err != nil { + return nil, err + } + for _, item := range configPage.PageItems { + appNames := strings.Split(item.Content, constants.CommaSeparator) + mappingResourceList = append(mappingResourceList, *lw.newMappingResource(item.DataId, appNames)) + } + if configPage.TotalCount <= pageNum*pageSize { + break + } + pageNum++ + } + return mappingResourceList, nil +} + +//func (lw *MappingListerWatcher) watchSingleMapping(res meshresource.ServiceProviderMappingResource) error { +// err := lw.configClient.Client().ListenConfig(nacosvo.ConfigParam{ +// DataId: res.Spec.ServiceName, +// Group: lw.cfg.Address.MetadataReport, +// OnChange: func(_, _, dataId, data string) { +// lw.resultChan <- watch.Event{ +// Type: watch.Modified, +// Object: lw.newMappingResource(res.Spec.ServiceName, strings.Split(data, constants.CommaSeparator)), +// } +// }, +// }) +// if err != nil { +// return bizerror.Wrap(err, bizerror.NacosError, fmt.Sprintf("cannot watch mapping %s", res.Name)) +// } +// return nil +//} + +func (lw *MappingListerWatcher) ResourceKind() coremodel.ResourceKind { + return meshresource.ServiceProviderMappingKind +} + +func (lw *MappingListerWatcher) newMappingResource( + serviceName string, + appNames []string) *meshresource.ServiceProviderMappingResource { + mappingRes := meshresource.NewServiceProviderMappingResourceWithAttributes(serviceName, lw.cfg.Name) + mappingRes.Spec = &meshproto.ServiceProviderMapping{ + ServiceName: serviceName, + AppNames: appNames, + } + return mappingRes +} + +func (lw *MappingListerWatcher) Stop() { + lw.stopWatch = true +} + +func (lw *MappingListerWatcher) ResultChan() <-chan watch.Event { + return lw.resultChan +} + +func (lw *MappingListerWatcher) TransformFunc() cache.TransformFunc { + return nil +} diff --git a/pkg/discovery/nacos2/listerwatcher/rpc_instance.go b/pkg/discovery/nacos2/listerwatcher/rpc_instance.go new file mode 100644 index 000000000..da2c4ceec --- /dev/null +++ b/pkg/discovery/nacos2/listerwatcher/rpc_instance.go @@ -0,0 +1,278 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package listerwatcher + +import ( + "encoding/json" + "fmt" + "regexp" + "strconv" + "time" + + set "github.com/duke-git/lancet/v2/datastructure/set" + "github.com/duke-git/lancet/v2/datetime" + "github.com/duke-git/lancet/v2/maputil" + "github.com/duke-git/lancet/v2/slice" + "github.com/go-co-op/gocron" + nacosnamingclient "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client" + nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" + nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" + + meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" + discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" +) + +type RPCInstanceListerWatcher struct { + cfg *discoverycfg.Config + namingClient nacosnamingclient.INamingClient + watchingApps set.Set[string] + scheduler *gocron.Scheduler + resultChan chan watch.Event + stopWatch bool +} + +func NewRPCInstanceListerWatcher(cfg *discoverycfg.Config, namingClient nacosnamingclient.INamingClient) *RPCInstanceListerWatcher { + return &RPCInstanceListerWatcher{ + cfg: cfg, + namingClient: namingClient, + resultChan: make(chan watch.Event), + watchingApps: set.New[string](), + scheduler: gocron.NewScheduler(time.UTC), + stopWatch: false, + } +} + +func (lw *RPCInstanceListerWatcher) List(_ metav1.ListOptions) (k8sruntime.Object, error) { + appNames, err := lw.fetchAllAppNames() + if err != nil { + return nil, err + } + resourceListObj := meshresource.NewRPCInstanceResourceList() + resList := make([]meshresource.RPCInstanceResource, 0) + for _, appName := range appNames { + appInstances, err := lw.namingClient.GetService(nacosvo.GetServiceParam{ + ServiceName: appName, + }) + if err != nil { + logger.Errorf("get instances of app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) + continue + } + for _, instance := range appInstances.Hosts { + resList = append(resList, *lw.toRPCInstanceResource(appName, instance)) + } + } + resourceListObj.Items = resList + return resourceListObj, nil +} + +func (lw *RPCInstanceListerWatcher) Watch(_ metav1.ListOptions) (watch.Interface, error) { + _, err := lw.scheduler.Every(lw.cfg.Properties.ServiceWatchPeriod).Seconds().Do(func() { + if lw.stopWatch { + logger.Debugf("stop watch all rpc instances of nacos %s", lw.cfg.Address.Registry) + lw.scheduler.Stop() + return + } + startTime := time.Now() + logger.Debugf("start fetching all rpc instances in nacos %s at %s", lw.cfg.Address.Registry, startTime) + appNames, err := lw.fetchAllAppNames() + if err != nil { + logger.Errorf("fetch all app names failed in nacos %s, cause: %v", lw.cfg.Address.Registry, err) + return + } + costs := time.Now().UnixMilli() - startTime.UnixMilli() + logger.Debugf("finish fetching all rpc instances in nacos %s, costs %dms", lw.cfg.Address.Registry, costs) + newAppNames := set.FromSlice(appNames) + offlineAppNames := lw.watchingApps.Minus(newAppNames) + for _, appName := range offlineAppNames.ToSlice() { + err := lw.unsubscribeApp(appName) + if err != nil { + logger.Errorf("unsubscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) + } + lw.watchingApps.Delete(appName) + continue + } + for _, appName := range newAppNames.ToSlice() { + exist := lw.watchingApps.AddIfNotExist(appName) + if exist { + continue + } + err := lw.subscribeApp(appName) + if err != nil { + logger.Errorf("subscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) + } + } + }) + if err != nil { + return nil, bizerror.Wrap(err, bizerror.UnknownError, + fmt.Sprintf("watch all mappings of nacos %s in a schedule occurs error", lw.cfg.Address.Registry)) + } + lw.scheduler.StartAsync() + return lw, nil +} + +func (lw *RPCInstanceListerWatcher) fetchAllAppNames() ([]string, error) { + appNames := make([]string, 0) + // filter out interface-level provider metadata dataIds + const providerPattern = `^providers:[\w\.]+(?::[\w\.]*:|::[\w\.]*)?$` + providerRe := regexp.MustCompile(providerPattern) + // filter out consumer metadata dataIds + const consumerPattern = `^consumers:[\w\.]+(?::[\w\.]*:|::[\w\.]*)?$` + consumerRe := regexp.MustCompile(consumerPattern) + var pageSize uint32 = 100 + for pageNum := uint32(1); ; pageNum++ { + appInfos, err := lw.namingClient.GetAllServicesInfo(nacosvo.GetAllServiceInfoParam{ + PageSize: pageSize, + PageNo: pageNum, + }) + + if err != nil { + return nil, bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("get app names failed in nacos %s failed, page size: %d, page num: %d", lw.cfg.Address.Registry, pageSize, pageNum)) + } + for _, e := range appInfos.Doms { + if !providerRe.MatchString(e) && !consumerRe.MatchString(e) { + appNames = append(appNames, e) + } + } + // If the number of appInfos is less than the page size, it means that the last page has been reached + if appInfos.Count < int64(pageSize) { + return appNames, nil + } + } +} + +func (lw *RPCInstanceListerWatcher) subscribeApp(appName string) error { + err := lw.namingClient.Subscribe(&nacosvo.SubscribeParam{ + ServiceName: appName, + SubscribeCallback: func(instances []nacosmodel.Instance, err error) { + if err != nil { + logger.Errorf("subscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) + return + } + slice.ForEach(instances, func(index int, instance nacosmodel.Instance) { + lw.resultChan <- watch.Event{ + Type: watch.Deleted, Object: lw.toRPCInstanceResource(appName, instance)} + }) + }, + }) + if err != nil { + return bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("subscribe app %s failed in nacos %s", appName, lw.cfg.Address.Registry)) + } + lw.watchingApps.Add(appName) + return nil +} + +func (lw *RPCInstanceListerWatcher) unsubscribeApp(appName string) error { + return lw.namingClient.Unsubscribe(&nacosvo.SubscribeParam{ + ServiceName: appName, + SubscribeCallback: func(instances []nacosmodel.Instance, err error) { + if err != nil { + logger.Errorf("unsubscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) + return + } + }, + }) +} + +func (lw *RPCInstanceListerWatcher) toRPCInstanceResource(appName string, instance nacosmodel.Instance) *meshresource.RPCInstanceResource { + resName := meshresource.BuildInstanceResName(appName, instance.Ip, int64(instance.Port)) + res := meshresource.NewRPCInstanceResourceWithAttributes(resName, lw.cfg.Name) + var registerTime string + timestamp, err := strconv.ParseInt(instance.Metadata[constants.TimestampKey], 10, 64) + if err != nil { + registerTime = "" + } else { + registerTime = datetime.FormatTimeToStr(time.UnixMilli(timestamp), "2006-01-02 15:04:05") + } + revision := instance.Metadata[constants.MetadataRevisionKey] + metadataStorageType := instance.Metadata[constants.MetadataStorageTypeKey] + urlParams, exists := instance.Metadata[constants.URLParamsKey] + relaseVersion := "" + protocol := "" + serialization := "" + preferSerialization := "" + if exists { + paramsMap := make(map[string]string) + err := json.Unmarshal([]byte(urlParams), ¶msMap) + if err != nil { + logger.Warnf("parse url params failed, raw url params string: %s, cause: %v", urlParams, err) + } + relaseVersion = paramsMap[constants.ReleaseKey] + protocol = paramsMap[constants.DubboVersionKey] + serialization = paramsMap[constants.SerializationKey] + preferSerialization = paramsMap[constants.SerializationKey] + + } + var endpoints []*meshproto.Endpoint + err = json.Unmarshal([]byte(instance.Metadata[constants.EndpointsKey]), &endpoints) + if err != nil { + logger.Warnf("parse endpoints failed, raw endpoints string: %s, cause: %v", instance.Metadata[constants.EndpointsKey], err) + } + res.Spec = &meshproto.RPCInstance{ + Name: resName, + AppName: appName, + Ip: instance.Ip, + Port: int64(instance.Port), + RegisterTime: registerTime, + UnregisterTime: "", + Revision: revision, + MetadataStorageType: metadataStorageType, + ReleaseVersion: relaseVersion, + Protocol: protocol, + Serialization: serialization, + PreferSerialization: preferSerialization, + Tags: getRPCInstanceTags(instance.Metadata), + Endpoints: endpoints, + Metadata: instance.Metadata, + } + return res +} + +func getRPCInstanceTags(metadata map[string]string) map[string]string { + knownKeys := set.New[string](constants.URLParamsKey, constants.EndpointsKey, + constants.MetadataRevisionKey, constants.MetadataStorageTypeKey, constants.TimestampKey) + return maputil.Filter(metadata, func(key string, value string) bool { + return !knownKeys.Contain(key) + }) +} + +func (lw *RPCInstanceListerWatcher) ResourceKind() coremodel.ResourceKind { + return meshresource.RPCInstanceKind +} + +func (lw *RPCInstanceListerWatcher) TransformFunc() cache.TransformFunc { + return nil +} + +func (lw *RPCInstanceListerWatcher) Stop() { + lw.stopWatch = true +} + +func (lw *RPCInstanceListerWatcher) ResultChan() <-chan watch.Event { + return lw.resultChan +} diff --git a/pkg/discovery/nacos2/listerwatcher/service_consumer_metadata.go b/pkg/discovery/nacos2/listerwatcher/service_consumer_metadata.go new file mode 100644 index 000000000..7bef9c8a8 --- /dev/null +++ b/pkg/discovery/nacos2/listerwatcher/service_consumer_metadata.go @@ -0,0 +1,251 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package listerwatcher + +import ( + "fmt" + "regexp" + "time" + + "github.com/duke-git/lancet/v2/convertor" + set "github.com/duke-git/lancet/v2/datastructure/set" + "github.com/duke-git/lancet/v2/slice" + "github.com/go-co-op/gocron" + nacosnamingclient "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client" + nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" + nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" + + meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" + discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" +) + +type ServiceConsumerMetadataListerWatcher struct { + cfg *discoverycfg.Config + namingClient nacosnamingclient.INamingClient + watchingConsumers set.Set[string] + scheduler *gocron.Scheduler + resultChan chan watch.Event + stopWatch bool +} + +func NewServiceConsumerMetadataListerWatcher( + cfg *discoverycfg.Config, + namingClient nacosnamingclient.INamingClient) *ServiceConsumerMetadataListerWatcher { + return &ServiceConsumerMetadataListerWatcher{ + cfg: cfg, + namingClient: namingClient, + resultChan: make(chan watch.Event), + watchingConsumers: set.New[string](), + scheduler: gocron.NewScheduler(time.UTC), + stopWatch: false, + } +} + +func (lw *ServiceConsumerMetadataListerWatcher) List(_ metav1.ListOptions) (k8sruntime.Object, error) { + consumerKeys, err := lw.fetchAllServiceConsumerKeys() + if err != nil { + return nil, err + } + resListObj := meshresource.NewServiceConsumerMetadataResourceList() + resList := make([]meshresource.ServiceConsumerMetadataResource, 0) + for _, ck := range consumerKeys { + consumers, err := lw.namingClient.GetService(nacosvo.GetServiceParam{ + ServiceName: ck, + }) + if err != nil { + logger.Errorf("get service consumers %s failed in nacos %s, cause: %v", ck, lw.cfg.Address.Registry, err) + continue + } + for _, consumer := range consumers.Hosts { + res := lw.toServiceConsumerMetadataResource(ck, consumer) + if res != nil { + resList = append(resList, *res) + } + } + } + resListObj.Items = resList + return resListObj, nil +} + +func (lw *ServiceConsumerMetadataListerWatcher) Watch(_ metav1.ListOptions) (watch.Interface, error) { + _, err := lw.scheduler.Every(lw.cfg.Properties.ConfigWatchPeriod).Seconds().Do(func() { + if lw.stopWatch { + logger.Debugf("stop watch all service consumer metadata of nacos %s", lw.cfg.Address) + lw.scheduler.Stop() + return + } + startTime := time.Now() + logger.Debugf("start fetching all service consumer metadata in nacos %s at %s", lw.cfg.Address.Registry, startTime) + serviceConsumerNames, err := lw.fetchAllServiceConsumerKeys() + if err != nil { + logger.Errorf("fetch all service consumer failed in nacos %s, cause: %v", lw.cfg.Address.Registry, err) + return + } + costs := time.Now().UnixMilli() - startTime.UnixMilli() + logger.Debugf("fetch all service consumer metadata in nacos %s succeed, costs %dms", lw.cfg.Address.Registry, costs) + newConsumers := set.FromSlice(serviceConsumerNames) + offlineConsumers := lw.watchingConsumers.Minus(newConsumers) + for _, consumerName := range offlineConsumers.ToSlice() { + err := lw.unsubscribeServiceConsumer(consumerName) + if err != nil { + logger.Errorf("unsubscribe service consumer %s failed in nacos %s, cause: %v", + consumerName, lw.cfg.Address.Registry, err) + } + lw.watchingConsumers.Delete(consumerName) + logger.Debugf("unsubscribe service consumer %s succeed in nacos %s", consumerName, lw.cfg.Address.Registry) + continue + } + for _, consumerName := range newConsumers.ToSlice() { + exist := lw.watchingConsumers.AddIfNotExist(consumerName) + if exist { + continue + } + err := lw.subscribeServiceConsumer(consumerName) + if err != nil { + logger.Errorf("subscribe service consumer %s failed in nacos %s, cause: %v", consumerName, lw.cfg.Address.Registry, err) + } + } + }) + if err != nil { + return nil, bizerror.Wrap(err, bizerror.UnknownError, + fmt.Sprintf("watch all mappings of nacos %s in a schedule occurs error", lw.cfg.Address)) + } + lw.scheduler.StartAsync() + return lw, nil +} + +func (lw *ServiceConsumerMetadataListerWatcher) fetchAllServiceConsumerKeys() ([]string, error) { + allKeys := make([]string, 0) + //Filter out interface-level DataIds + const pattern = `^consumers:[\w\.]+(?::[\w\.]*:|::[\w\.]*)?$` + re := regexp.MustCompile(pattern) + var pageSize uint32 = 100 + for pageNum := uint32(1); ; pageNum++ { + consumerKeys, err := lw.namingClient.GetAllServicesInfo(nacosvo.GetAllServiceInfoParam{ + PageSize: pageSize, + PageNo: pageNum, + }) + + if err != nil { + return nil, bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("get service consumer keys failed in nacos %s failed, page size: %d, page num: %d", + lw.cfg.Address, pageSize, pageNum)) + } + for _, key := range consumerKeys.Doms { + if re.MatchString(key) { + allKeys = append(allKeys, key) + } + } + // If the number of consumerKeys is less than the page size, it means that the last page has been reached + if consumerKeys.Count < int64(pageSize) { + return allKeys, nil + } + } +} + +func (lw *ServiceConsumerMetadataListerWatcher) subscribeServiceConsumer(consumerKey string) error { + err := lw.namingClient.Subscribe(&nacosvo.SubscribeParam{ + ServiceName: consumerKey, + SubscribeCallback: func(instances []nacosmodel.Instance, err error) { + if err != nil { + logger.Errorf("subscribe service consumer %s failed in nacos %s, cause: %v", + consumerKey, lw.cfg.Address.Registry, err) + return + } + slice.ForEach(instances, func(index int, instance nacosmodel.Instance) { + lw.resultChan <- watch.Event{ + Type: watch.Modified, Object: lw.toServiceConsumerMetadataResource(consumerKey, instance)} + }) + }, + }) + if err != nil { + return bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("subscribe service consumer %s failed in nacos %s", consumerKey, lw.cfg.Address.Registry)) + } + return nil +} + +func (lw *ServiceConsumerMetadataListerWatcher) unsubscribeServiceConsumer(appName string) error { + return lw.namingClient.Unsubscribe(&nacosvo.SubscribeParam{ + ServiceName: appName, + SubscribeCallback: func(instances []nacosmodel.Instance, err error) { + if err != nil { + logger.Errorf("unsubscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) + return + } + }, + }) +} + +func (lw *ServiceConsumerMetadataListerWatcher) toServiceConsumerMetadataResource(consumerKey string, instance nacosmodel.Instance) *meshresource.ServiceConsumerMetadataResource { + metadataJsonStr, err := convertor.ToJson(instance.Metadata) + if err != nil { + logger.Errorf("skipping convert service consumer %s:%d of %s to ServiceConsumerMetadata "+ + "because it cannot convert to json string", instance.Ip, instance.Port, consumerKey) + return nil + } + consumerAppName, exists := instance.Metadata[constants.Application] + if !exists { + logger.Errorf("service consumer %s:%d of %s is invalid because no application name found, raw metadata: %s", + instance.Ip, instance.Port, consumerKey, metadataJsonStr) + return nil + } + serviceName, exists := instance.Metadata[constants.InterfaceKey] + if !exists { + logger.Errorf("service consumer %s:%d of %s is invalid because no service name found, raw metadata: %s", + instance.Ip, instance.Port, consumerKey, metadataJsonStr) + return nil + } + version := instance.Metadata[constants.VersionKey] + group := instance.Metadata[constants.GroupKey] + resKey := consumerAppName + ":" + consumerKey + res := meshresource.NewServiceConsumerMetadataResourceWithAttributes(resKey, lw.cfg.Name) + res.Spec = &meshproto.ServiceConsumerMetadata{ + ServiceName: serviceName, + ConsumerAppName: consumerAppName, + Version: version, + Group: group, + Metadata: instance.Metadata, + } + return res +} + +func (lw *ServiceConsumerMetadataListerWatcher) ResourceKind() coremodel.ResourceKind { + return meshresource.ServiceConsumerMetadataKind +} + +func (lw *ServiceConsumerMetadataListerWatcher) TransformFunc() cache.TransformFunc { + return nil +} + +func (lw *ServiceConsumerMetadataListerWatcher) Stop() { + lw.stopWatch = true +} + +func (lw *ServiceConsumerMetadataListerWatcher) ResultChan() <-chan watch.Event { + return lw.resultChan +} diff --git a/pkg/discovery/nacos2/listerwatcher/service_provider_metadata.go b/pkg/discovery/nacos2/listerwatcher/service_provider_metadata.go new file mode 100644 index 000000000..2f015ecf5 --- /dev/null +++ b/pkg/discovery/nacos2/listerwatcher/service_provider_metadata.go @@ -0,0 +1,162 @@ +package listerwatcher + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/duke-git/lancet/v2/convertor" + "github.com/duke-git/lancet/v2/slice" + "github.com/go-co-op/gocron" + nacosconfigclient "github.com/nacos-group/nacos-sdk-go/v2/clients/config_client" + nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" + nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" + + meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" + discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" +) + +const DubboGroup = "dubbo" + +type ServiceProviderMetadataListerWatcher struct { + cfg *discoverycfg.Config + configClient nacosconfigclient.IConfigClient + resultChan chan watch.Event + scheduler *gocron.Scheduler + stopWatch bool +} + +func NewServiceProviderMetadataListerWatcher( + cfg *discoverycfg.Config, + configClient nacosconfigclient.IConfigClient, +) *ServiceProviderMetadataListerWatcher { + return &ServiceProviderMetadataListerWatcher{ + cfg: cfg, + configClient: configClient, + resultChan: make(chan watch.Event), + scheduler: gocron.NewScheduler(time.UTC), + stopWatch: false, + } +} + +func (lw *ServiceProviderMetadataListerWatcher) List(_ metav1.ListOptions) (k8sruntime.Object, error) { + resList := meshresource.NewServiceProviderMetadataResourceList() + metadataResources, err := lw.fetchAllProviderMetadata() + if err != nil { + return nil, err + } + resList.Items = metadataResources + return resList, nil +} + +func (lw *ServiceProviderMetadataListerWatcher) Watch(_ metav1.ListOptions) (watch.Interface, error) { + _, err := lw.scheduler.Every(lw.cfg.Properties.ConfigWatchPeriod).Seconds().Do(func() { + if lw.stopWatch { + logger.Debugf("stop watching metadata in nacos %s", lw.cfg.Address.MetadataReport) + lw.scheduler.Stop() + } + startTime := time.Now() + logger.Debugf("start fetching all service provider metadata in nacos %s at %s", lw.cfg.Address.MetadataReport, startTime) + metadataResources, err := lw.fetchAllProviderMetadata() + if err != nil { + logger.Errorf("fetch all service provider metadata in nacos %s failed, cause: %s", lw.cfg.Address.MetadataReport, err.Error()) + return + } + costs := time.Now().UnixMilli() - startTime.UnixMilli() + logger.Debugf("fetched all service provider metadata in nacos %s, costs %dms", lw.cfg.Address.MetadataReport, costs) + slice.ForEach(metadataResources, func(index int, item meshresource.ServiceProviderMetadataResource) { + lw.resultChan <- watch.Event{ + Type: watch.Modified, + Object: &item, + } + }) + }) + if err != nil { + return nil, bizerror.Wrap(err, bizerror.UnknownError, + fmt.Sprintf("fetch all metadata of nacos %s in a schedule occurs error", lw.cfg.Address.MetadataReport)) + } + lw.scheduler.StartAsync() + return lw, nil +} + +func (lw *ServiceProviderMetadataListerWatcher) fetchAllProviderMetadata() ([]meshresource.ServiceProviderMetadataResource, error) { + listPage := func(pageNum int, pageSize int) (*nacosmodel.ConfigPage, error) { + configPage, err := lw.configClient.SearchConfig(nacosvo.SearchConfigParam{ + Search: "blur", + DataId: "*:provider:*", + Group: DubboGroup, + PageNo: pageNum, + PageSize: pageSize, + }) + if err != nil { + errMsg := fmt.Sprintf("cannot do page list of config, page size %d, page num %d, nacos address %s", + pageSize, pageNum, lw.cfg.Address.MetadataReport) + return nil, bizerror.Wrap(err, bizerror.NacosError, errMsg) + } + logger.Debugf("list config page, page size %d, page num %d, nacos address %s, total count %d, items %s", + pageSize, pageNum, lw.cfg.Address.MetadataReport, configPage.TotalCount, convertor.ToString(configPage.PageItems)) + return configPage, nil + } + resList := make([]meshresource.ServiceProviderMetadataResource, 0) + pageNum := 1 + pageSize := 50 + // list all metadata by page search + for { + configPage, err := listPage(pageNum, pageSize) + if err != nil { + return nil, err + } + for _, item := range configPage.PageItems { + res := lw.toMetadataResource(item) + if res != nil { + resList = append(resList, *res) + } + } + if configPage.TotalCount <= pageNum*pageSize { + break + } + pageNum++ + } + return resList, nil +} + +func (lw *ServiceProviderMetadataListerWatcher) ResourceKind() coremodel.ResourceKind { + return meshresource.ServiceProviderMetadataKind +} + +func (lw *ServiceProviderMetadataListerWatcher) toMetadataResource(configItem nacosmodel.ConfigItem) *meshresource.ServiceProviderMetadataResource { + metadataSpec := &meshproto.ServiceProviderMetadata{} + err := json.Unmarshal([]byte(configItem.Content), metadataSpec) + if err != nil { + logger.Errorf("failed to unmarshal provider service metadata %s, cause: %v", configItem.Content, err) + return nil + } + metadataSpec.ServiceName = metadataSpec.CanonicalName + metadataSpec.Version = metadataSpec.Parameters[constants.VersionKey] + metadataSpec.Group = metadataSpec.Parameters[constants.GroupKey] + + metadataRes := meshresource.NewServiceProviderMetadataResourceWithAttributes(configItem.DataId, lw.cfg.Name) + metadataRes.Spec = metadataSpec + return metadataRes +} + +func (lw *ServiceProviderMetadataListerWatcher) Stop() { + lw.stopWatch = true +} + +func (lw *ServiceProviderMetadataListerWatcher) ResultChan() <-chan watch.Event { + return lw.resultChan +} + +func (lw *ServiceProviderMetadataListerWatcher) TransformFunc() cache.TransformFunc { + return nil +} diff --git a/pkg/engine/kubernetes/factory.go b/pkg/engine/kubernetes/factory.go index 946f3e7a0..f1fa79170 100644 --- a/pkg/engine/kubernetes/factory.go +++ b/pkg/engine/kubernetes/factory.go @@ -28,6 +28,7 @@ import ( enginecfg "github.com/apache/dubbo-admin/pkg/config/engine" "github.com/apache/dubbo-admin/pkg/core/controller" "github.com/apache/dubbo-admin/pkg/core/engine" + "github.com/apache/dubbo-admin/pkg/engine/kubernetes/listerwatcher" ) func init() { @@ -66,7 +67,7 @@ func (e *EngineFactory) NewListWatchers(cfg *enginecfg.Config) ([]controller.Res } lwList := make([]controller.ResourceListerWatcher, 0) - podListerWatcher, err := NewPodListWatcher(clientset, cfg) + podListerWatcher, err := listerwatcher.NewPodListWatcher(clientset, cfg) if err != nil { return nil, fmt.Errorf("failed to init PodListerWatcher in kubernetes engine, %w", err) } diff --git a/pkg/engine/kubernetes/engine.go b/pkg/engine/kubernetes/listerwatcher/runtime_instance.go similarity index 85% rename from pkg/engine/kubernetes/engine.go rename to pkg/engine/kubernetes/listerwatcher/runtime_instance.go index 14757c180..d0289e4b5 100644 --- a/pkg/engine/kubernetes/engine.go +++ b/pkg/engine/kubernetes/listerwatcher/runtime_instance.go @@ -15,11 +15,12 @@ * limitations under the License. */ -package kubernetes +package listerwatcher import ( "fmt" "reflect" + "strconv" "github.com/duke-git/lancet/v2/slice" "github.com/duke-git/lancet/v2/strutil" @@ -33,6 +34,7 @@ import ( meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" enginecfg "github.com/apache/dubbo-admin/pkg/config/engine" "github.com/apache/dubbo-admin/pkg/core/consts" "github.com/apache/dubbo-admin/pkg/core/controller" @@ -92,6 +94,7 @@ func (p *PodListerWatcher) TransformFunc() cache.TransformFunc { } mainContainer := p.getMainContainer(pod) appName := p.getDubboAppName(pod) + rpcPort := p.getDubboRPCPort(pod) var startTime string if pod.Status.StartTime != nil { startTime = pod.Status.StartTime.Format(consts.TimeFormatStr) @@ -148,10 +151,11 @@ func (p *PodListerWatcher) TransformFunc() cache.TransformFunc { }) } } - res := meshresource.NewRuntimeInstanceResourceWithAttributes(pod.Name, "default") + res := meshresource.NewRuntimeInstanceResourceWithAttributes(pod.Name, p.getDubboMesh(pod)) res.Spec = &meshproto.RuntimeInstance{ Name: pod.Name, Ip: pod.Status.PodIP, + RpcPort: rpcPort, Image: image, AppName: appName, CreateTime: createTime, @@ -218,6 +222,39 @@ func (p *PodListerWatcher) getDubboAppName(pod *v1.Pod) string { } } +func (p *PodListerWatcher) getDubboRPCPort(pod *v1.Pod) int64 { + identifier := p.cfg.Properties.DubboRPCPortIdentifier + var rpcPort int64 + var err error + switch identifier.Type { + case enginecfg.IdentifyByAnnotation: + rpcPort, err = strconv.ParseInt(pod.Annotations[identifier.AnnotationKey], 10, 64) + case enginecfg.IdentifyByLabel: + rpcPort, err = strconv.ParseInt(pod.Labels[identifier.LabelKey], 10, 64) + default: + rpcPort = 0 + } + if err != nil { + logger.Warnf("failed to parse dubbo rpc port %s, cannot retrieve the correct dubbo rpc port", + pod.Annotations[identifier.AnnotationKey]) + } + return rpcPort +} + +func (p *PodListerWatcher) getDubboMesh(pod *v1.Pod) string { + identifier := p.cfg.Properties.DubboRegistryIdentifier + var mesh string + switch identifier.Type { + case enginecfg.IdentifyByAnnotation: + mesh = pod.Annotations[identifier.AnnotationKey] + case enginecfg.IdentifyByLabel: + mesh = pod.Labels[identifier.LabelKey] + default: + mesh = constants.DefaultMesh + } + return mesh +} + func (p *PodListerWatcher) getProbePort(probe *v1.Probe) int32 { if probe.TCPSocket != nil { return probe.TCPSocket.Port.IntVal diff --git a/scripts/resourcegen/gen.go b/scripts/resourcegen/gen.go index d61606067..80c1f6081 100644 --- a/scripts/resourcegen/gen.go +++ b/scripts/resourcegen/gen.go @@ -102,12 +102,6 @@ type {{.Name}}ResourceStatus struct { // define resource-specific status here } -type {{.Name}}ResourceList struct { - metav1.TypeMeta {{ $tk }}json:",inline"{{ $tk }} - metav1.ListMeta {{ $tk }}json:"metadata,omitempty"{{ $tk }} - Items []{{.Name}}Resource {{ $tk }}json:"items"{{ $tk }} -} - func (r *{{.Name}}Resource) ResourceKind() coremodel.ResourceKind { return {{.Name}}Kind } @@ -127,11 +121,8 @@ func (r *{{.Name}}Resource) ResourceMeta() metav1.ObjectMeta { func (r *{{.Name}}Resource) ResourceSpec() coremodel.ResourceSpec { return r.Spec } -func (r *{{.Name}}Resource) DeepCopyObject() k8sruntime.Object { - if r == nil { - return nil - } +func (r *{{.Name}}Resource) DeepCopyObject() k8sruntime.Object { out := &{{.Name}}Resource{ TypeMeta: r.TypeMeta, Mesh: r.Mesh, @@ -172,6 +163,7 @@ func New{{.Name}}ResourceWithAttributes(name string, mesh string) *{{.Name}}Reso Labels: map[string]string{}, }, Mesh: mesh, + Spec: &meshproto.{{.Name}}{}, } } @@ -181,6 +173,38 @@ func New{{.Name}}Resource() coremodel.Resource { Kind: string({{.Name}}Kind), APIVersion: "v1alpha1", }, + Spec: &meshproto.{{.Name}}{}, + } +} + +type {{.Name}}ResourceList struct { + metav1.TypeMeta {{ $tk }}json:",inline"{{ $tk }} + metav1.ListMeta {{ $tk }}json:"metadata,omitempty"{{ $tk }} + Items []{{.Name}}Resource {{ $tk }}json:"items"{{ $tk }} +} + +func (r *{{.Name}}ResourceList) DeepCopyObject() k8sruntime.Object { + out := &{{.Name}}ResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]{{.Name}}Resource, len(r.Items)) + for i := range r.Items { + out.Items[i] = *r.Items[i].DeepCopyObject().(*{{.Name}}Resource) + } + return out +} + +func New{{.Name}}ResourceList() *{{.Name}}ResourceList { + return &{{.Name}}ResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string({{.Name}}Kind), + APIVersion: "v1alpha1", + }, } } From f9fd26c0490baf3669d2b54c6608d27aa80ed8e6 Mon Sep 17 00:00:00 2001 From: robocanic Date: Sat, 13 Dec 2025 17:07:43 +0800 Subject: [PATCH 2/5] refractor: abstract nacos and nacos service --- api/mesh/v1alpha1/condition_route_helper.go | 14 +- api/mesh/v1alpha1/dynamic_config.proto | 1 - api/mesh/v1alpha1/dynamic_config_helper.go | 4 +- api/mesh/v1alpha1/nacos_config.pb.go | 146 +++++++ api/mesh/v1alpha1/nacos_config.proto | 19 + api/mesh/v1alpha1/nacos_service.pb.go | 226 ++++++++++ api/mesh/v1alpha1/nacos_service.proto | 28 ++ api/mesh/v1alpha1/runtime_instance.pb.go | 121 +++--- api/mesh/v1alpha1/traffic_helper.go | 17 +- app/dubbo-admin/dubbo-admin.yaml | 12 +- go.mod | 52 +-- go.sum | 309 +++----------- pkg/common/constants/common.go | 38 ++ pkg/common/constants/constants.go | 82 ++-- pkg/common/constants/nacos.go | 27 ++ pkg/common/constants/rule.go | 40 ++ pkg/config/engine/config.go | 1 + pkg/console/handler/condition_rule.go | 34 +- pkg/console/handler/configurator_rule.go | 20 +- pkg/console/handler/instance.go | 22 +- pkg/console/handler/service.go | 36 +- pkg/console/handler/tag_rule.go | 26 +- pkg/console/model/application.go | 9 +- pkg/console/model/condition_rule.go | 38 +- pkg/console/model/service.go | 4 +- pkg/console/model/tag_rule.go | 4 +- pkg/console/service/application.go | 34 +- pkg/core/bootstrap/init.go | 1 + pkg/core/consts/const.go | 107 ----- pkg/core/controller/informer.go | 36 +- pkg/core/discovery/component.go | 49 ++- .../discovery/subscriber/nacos_service.go | 402 ++++++++++++++++++ pkg/core/discovery/subscriber/rpc_instance.go | 87 ++-- .../subscriber/service_consumer_metadata.go | 108 +++++ .../subscriber/service_provider_metadata.go | 108 +++++ pkg/core/engine/component.go | 4 +- .../engine/subscriber/runtime_instance.go | 34 +- pkg/core/events/component.go | 2 +- .../apis/mesh/v1alpha1/affinityroute_types.go | 33 +- .../apis/mesh/v1alpha1/application_types.go | 33 +- .../mesh/v1alpha1/conditionroute_types.go | 33 +- .../apis/mesh/v1alpha1/dynamicconfig_types.go | 33 +- .../apis/mesh/v1alpha1/instance_helper.go | 54 +++ .../apis/mesh/v1alpha1/instance_types.go | 33 +- .../apis/mesh/v1alpha1/nacosconfig_types.go | 188 ++++++++ .../apis/mesh/v1alpha1/nacosservice_types.go | 188 ++++++++ .../apis/mesh/v1alpha1/rpcinstance_types.go | 33 +- .../v1alpha1/rpcinstancemetadata_types.go | 33 +- .../mesh/v1alpha1/runtimeinstance_types.go | 33 +- .../apis/mesh/v1alpha1/service_helper.go | 4 +- .../apis/mesh/v1alpha1/service_types.go | 33 +- .../v1alpha1/serviceconsumermetadata_types.go | 33 +- .../v1alpha1/serviceprovidermapping_types.go | 33 +- .../v1alpha1/serviceprovidermetadata_types.go | 33 +- .../apis/mesh/v1alpha1/tagroute_types.go | 33 +- pkg/core/resource/model/registry.go | 39 +- pkg/core/resource/model/resource.go | 15 +- pkg/core/store/component.go | 9 +- pkg/core/store/index/instance.go | 4 +- pkg/core/store/index/rpc_instance.go | 49 +++ pkg/core/store/index/runtime_instance.go | 47 ++ .../store/index/service_consumer_metadata.go | 17 +- pkg/discovery/nacos2/factory.go | 165 ++++++- pkg/discovery/nacos2/listerwatcher/mapping.go | 188 -------- .../nacos2/listerwatcher/nacos_config.go | 292 +++++++++++++ .../nacos2/listerwatcher/nacos_service.go | 273 ++++++++++++ .../nacos2/listerwatcher/rpc_instance.go | 278 ------------ .../service_consumer_metadata.go | 251 ----------- .../service_provider_metadata.go | 162 ------- .../listerwatcher/runtime_instance.go | 9 +- pkg/engine/mock/factory.go | 40 ++ pkg/store/dbcommon/gorm_store.go | 10 +- pkg/store/dbcommon/model.go | 16 +- scripts/resourcegen/gen.go | 32 +- 74 files changed, 3352 insertions(+), 1709 deletions(-) create mode 100644 api/mesh/v1alpha1/nacos_config.pb.go create mode 100644 api/mesh/v1alpha1/nacos_config.proto create mode 100644 api/mesh/v1alpha1/nacos_service.pb.go create mode 100644 api/mesh/v1alpha1/nacos_service.proto create mode 100644 pkg/common/constants/common.go create mode 100644 pkg/common/constants/nacos.go create mode 100644 pkg/common/constants/rule.go delete mode 100644 pkg/core/consts/const.go create mode 100644 pkg/core/discovery/subscriber/nacos_service.go create mode 100644 pkg/core/discovery/subscriber/service_consumer_metadata.go create mode 100644 pkg/core/discovery/subscriber/service_provider_metadata.go create mode 100644 pkg/core/resource/apis/mesh/v1alpha1/nacosconfig_types.go create mode 100644 pkg/core/resource/apis/mesh/v1alpha1/nacosservice_types.go create mode 100644 pkg/core/store/index/rpc_instance.go create mode 100644 pkg/core/store/index/runtime_instance.go delete mode 100644 pkg/discovery/nacos2/listerwatcher/mapping.go create mode 100644 pkg/discovery/nacos2/listerwatcher/nacos_config.go create mode 100644 pkg/discovery/nacos2/listerwatcher/nacos_service.go delete mode 100644 pkg/discovery/nacos2/listerwatcher/rpc_instance.go delete mode 100644 pkg/discovery/nacos2/listerwatcher/service_consumer_metadata.go delete mode 100644 pkg/discovery/nacos2/listerwatcher/service_provider_metadata.go create mode 100644 pkg/engine/mock/factory.go diff --git a/api/mesh/v1alpha1/condition_route_helper.go b/api/mesh/v1alpha1/condition_route_helper.go index 7fb21235b..d3f3c529f 100644 --- a/api/mesh/v1alpha1/condition_route_helper.go +++ b/api/mesh/v1alpha1/condition_route_helper.go @@ -23,15 +23,15 @@ import ( "github.com/pkg/errors" "sigs.k8s.io/yaml" + "github.com/apache/dubbo-admin/pkg/common/constants" "github.com/apache/dubbo-admin/pkg/common/util/proto" - "github.com/apache/dubbo-admin/pkg/core/consts" ) func (x *ConditionRoute) GetVersion() string { if x.ToConditionRouteV3() != nil { - return consts.ConfiguratorVersionV3 + return constants.ConfiguratorVersionV3 } else { - return consts.ConfiguratorVersionV3x1 + return constants.ConfiguratorVersionV3x1 } } @@ -51,17 +51,17 @@ func ConditionRouteDecodeFromYAML(content []byte) (*ConditionRoute, error) { return nil, err } - version, ok := _map[consts.ConfigVersionKey].(string) + version, ok := _map[constants.ConfigVersionKey].(string) if !ok { return nil, errors.New("invalid condition route format") } - if version == consts.ConfiguratorVersionV3 { + if version == constants.ConfiguratorVersionV3 { v3 := new(ConditionRouteV3) if err = proto.FromYAML(content, v3); err != nil { return nil, err } return v3.ToConditionRoute(), nil - } else if version == consts.ConfiguratorVersionV3x1 { + } else if version == constants.ConfiguratorVersionV3x1 { v3x1 := new(ConditionRouteV3X1) if err = proto.FromYAML(content, v3x1); err != nil { return nil, err @@ -133,7 +133,7 @@ func (x *ConditionRule) IsMatchMethod() (string, bool) { conditions := strings.Split(x.From.Match, "&") for _, condition := range conditions { if idx := strings.Index(condition, "method"); idx != -1 { - args := strings.Split(condition, consts.Equal) + args := strings.Split(condition, constants.Equal) if len(args) == 2 { return strings.TrimSpace(args[1]), true } diff --git a/api/mesh/v1alpha1/dynamic_config.proto b/api/mesh/v1alpha1/dynamic_config.proto index 427f7e6c2..7521494a8 100644 --- a/api/mesh/v1alpha1/dynamic_config.proto +++ b/api/mesh/v1alpha1/dynamic_config.proto @@ -12,7 +12,6 @@ message DynamicConfig { option (dubbo.mesh.resource).plural_name = "DynamicConfigs"; option (dubbo.mesh.resource).package = "mesh"; option (dubbo.mesh.resource).is_experimental = false; - string key = 1; string scope = 2; string configVersion = 3; diff --git a/api/mesh/v1alpha1/dynamic_config_helper.go b/api/mesh/v1alpha1/dynamic_config_helper.go index 26d666a02..2d2369498 100644 --- a/api/mesh/v1alpha1/dynamic_config_helper.go +++ b/api/mesh/v1alpha1/dynamic_config_helper.go @@ -20,12 +20,12 @@ package v1alpha1 import ( "strings" - "github.com/apache/dubbo-admin/pkg/core/consts" + "github.com/apache/dubbo-admin/pkg/common/constants" ) func GetOverridePath(key string) string { key = strings.Replace(key, "/", "*", -1) - return key + consts.ConfiguratorRuleSuffix + return key + constants.ConfiguratorRuleSuffix } func (d *DynamicConfig) ListUnGenConfigs() []*OverrideConfig { diff --git a/api/mesh/v1alpha1/nacos_config.pb.go b/api/mesh/v1alpha1/nacos_config.pb.go new file mode 100644 index 000000000..c1a01c060 --- /dev/null +++ b/api/mesh/v1alpha1/nacos_config.pb.go @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.12.4 +// source: api/mesh/v1alpha1/nacos_config.proto + +package v1alpha1 + +import ( + _ "github.com/apache/dubbo-admin/api/mesh" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Nacos config is the raw data of nacos configuration +type NacosConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataId string `protobuf:"bytes,1,opt,name=dataId,proto3" json:"dataId,omitempty"` + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *NacosConfig) Reset() { + *x = NacosConfig{} + mi := &file_api_mesh_v1alpha1_nacos_config_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NacosConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NacosConfig) ProtoMessage() {} + +func (x *NacosConfig) ProtoReflect() protoreflect.Message { + mi := &file_api_mesh_v1alpha1_nacos_config_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NacosConfig.ProtoReflect.Descriptor instead. +func (*NacosConfig) Descriptor() ([]byte, []int) { + return file_api_mesh_v1alpha1_nacos_config_proto_rawDescGZIP(), []int{0} +} + +func (x *NacosConfig) GetDataId() string { + if x != nil { + return x.DataId + } + return "" +} + +func (x *NacosConfig) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +var File_api_mesh_v1alpha1_nacos_config_proto protoreflect.FileDescriptor + +var file_api_mesh_v1alpha1_nacos_config_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x16, 0x61, 0x70, 0x69, + 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x6a, 0x0a, 0x0b, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x61, 0x74, 0x61, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x64, 0x61, 0x74, 0x61, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x3a, 0x29, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x23, 0x0a, 0x0b, 0x4e, 0x61, + 0x63, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0c, 0x4e, 0x61, 0x63, 0x6f, 0x73, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x20, 0x01, 0x42, + 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, + 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_api_mesh_v1alpha1_nacos_config_proto_rawDescOnce sync.Once + file_api_mesh_v1alpha1_nacos_config_proto_rawDescData = file_api_mesh_v1alpha1_nacos_config_proto_rawDesc +) + +func file_api_mesh_v1alpha1_nacos_config_proto_rawDescGZIP() []byte { + file_api_mesh_v1alpha1_nacos_config_proto_rawDescOnce.Do(func() { + file_api_mesh_v1alpha1_nacos_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_mesh_v1alpha1_nacos_config_proto_rawDescData) + }) + return file_api_mesh_v1alpha1_nacos_config_proto_rawDescData +} + +var file_api_mesh_v1alpha1_nacos_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_api_mesh_v1alpha1_nacos_config_proto_goTypes = []any{ + (*NacosConfig)(nil), // 0: dubbo.mesh.v1alpha1.NacosConfig +} +var file_api_mesh_v1alpha1_nacos_config_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_api_mesh_v1alpha1_nacos_config_proto_init() } +func file_api_mesh_v1alpha1_nacos_config_proto_init() { + if File_api_mesh_v1alpha1_nacos_config_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_mesh_v1alpha1_nacos_config_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_mesh_v1alpha1_nacos_config_proto_goTypes, + DependencyIndexes: file_api_mesh_v1alpha1_nacos_config_proto_depIdxs, + MessageInfos: file_api_mesh_v1alpha1_nacos_config_proto_msgTypes, + }.Build() + File_api_mesh_v1alpha1_nacos_config_proto = out.File + file_api_mesh_v1alpha1_nacos_config_proto_rawDesc = nil + file_api_mesh_v1alpha1_nacos_config_proto_goTypes = nil + file_api_mesh_v1alpha1_nacos_config_proto_depIdxs = nil +} diff --git a/api/mesh/v1alpha1/nacos_config.proto b/api/mesh/v1alpha1/nacos_config.proto new file mode 100644 index 000000000..81b19e019 --- /dev/null +++ b/api/mesh/v1alpha1/nacos_config.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package dubbo.mesh.v1alpha1; + +option go_package = "github.com/apache/dubbo-admin/api/mesh/v1alpha1"; + +import "api/mesh/options.proto"; + +// Nacos config is the raw data of nacos configuration +message NacosConfig { + option (dubbo.mesh.resource).name = "NacosConfig"; + option (dubbo.mesh.resource).plural_name = "NacosConfigs"; + option (dubbo.mesh.resource).package = "mesh"; + option (dubbo.mesh.resource).is_experimental = true; + + string dataId = 1; + + string content = 2; +} \ No newline at end of file diff --git a/api/mesh/v1alpha1/nacos_service.pb.go b/api/mesh/v1alpha1/nacos_service.pb.go new file mode 100644 index 000000000..40a44d2d2 --- /dev/null +++ b/api/mesh/v1alpha1/nacos_service.pb.go @@ -0,0 +1,226 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.12.4 +// source: api/mesh/v1alpha1/nacos_service.proto + +package v1alpha1 + +import ( + _ "github.com/apache/dubbo-admin/api/mesh" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Nacos Service is the raw data of nacos service +type NacosService struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceKey string `protobuf:"bytes,1,opt,name=serviceKey,proto3" json:"serviceKey,omitempty"` + Instances []*NacosInstance `protobuf:"bytes,3,rep,name=instances,proto3" json:"instances,omitempty"` +} + +func (x *NacosService) Reset() { + *x = NacosService{} + mi := &file_api_mesh_v1alpha1_nacos_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NacosService) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NacosService) ProtoMessage() {} + +func (x *NacosService) ProtoReflect() protoreflect.Message { + mi := &file_api_mesh_v1alpha1_nacos_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NacosService.ProtoReflect.Descriptor instead. +func (*NacosService) Descriptor() ([]byte, []int) { + return file_api_mesh_v1alpha1_nacos_service_proto_rawDescGZIP(), []int{0} +} + +func (x *NacosService) GetServiceKey() string { + if x != nil { + return x.ServiceKey + } + return "" +} + +func (x *NacosService) GetInstances() []*NacosInstance { + if x != nil { + return x.Instances + } + return nil +} + +type NacosInstance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` + Port int64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *NacosInstance) Reset() { + *x = NacosInstance{} + mi := &file_api_mesh_v1alpha1_nacos_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NacosInstance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NacosInstance) ProtoMessage() {} + +func (x *NacosInstance) ProtoReflect() protoreflect.Message { + mi := &file_api_mesh_v1alpha1_nacos_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NacosInstance.ProtoReflect.Descriptor instead. +func (*NacosInstance) Descriptor() ([]byte, []int) { + return file_api_mesh_v1alpha1_nacos_service_proto_rawDescGZIP(), []int{1} +} + +func (x *NacosInstance) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *NacosInstance) GetPort() int64 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *NacosInstance) GetMetadata() map[string]string { + if x != nil { + return x.Metadata + } + return nil +} + +var File_api_mesh_v1alpha1_nacos_service_proto protoreflect.FileDescriptor + +var file_api_mesh_v1alpha1_nacos_service_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x16, 0x61, 0x70, + 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x01, 0x0a, 0x0c, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, + 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4e, + 0x61, 0x63, 0x6f, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x3a, 0x2a, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x24, 0x0a, + 0x0c, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0c, 0x4e, + 0x61, 0x63, 0x6f, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x04, 0x6d, 0x65, 0x73, + 0x68, 0x20, 0x01, 0x22, 0xbe, 0x01, 0x0a, 0x0d, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x4c, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x64, 0x75, + 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_api_mesh_v1alpha1_nacos_service_proto_rawDescOnce sync.Once + file_api_mesh_v1alpha1_nacos_service_proto_rawDescData = file_api_mesh_v1alpha1_nacos_service_proto_rawDesc +) + +func file_api_mesh_v1alpha1_nacos_service_proto_rawDescGZIP() []byte { + file_api_mesh_v1alpha1_nacos_service_proto_rawDescOnce.Do(func() { + file_api_mesh_v1alpha1_nacos_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_mesh_v1alpha1_nacos_service_proto_rawDescData) + }) + return file_api_mesh_v1alpha1_nacos_service_proto_rawDescData +} + +var file_api_mesh_v1alpha1_nacos_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_api_mesh_v1alpha1_nacos_service_proto_goTypes = []any{ + (*NacosService)(nil), // 0: dubbo.mesh.v1alpha1.NacosService + (*NacosInstance)(nil), // 1: dubbo.mesh.v1alpha1.NacosInstance + nil, // 2: dubbo.mesh.v1alpha1.NacosInstance.MetadataEntry +} +var file_api_mesh_v1alpha1_nacos_service_proto_depIdxs = []int32{ + 1, // 0: dubbo.mesh.v1alpha1.NacosService.instances:type_name -> dubbo.mesh.v1alpha1.NacosInstance + 2, // 1: dubbo.mesh.v1alpha1.NacosInstance.metadata:type_name -> dubbo.mesh.v1alpha1.NacosInstance.MetadataEntry + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_api_mesh_v1alpha1_nacos_service_proto_init() } +func file_api_mesh_v1alpha1_nacos_service_proto_init() { + if File_api_mesh_v1alpha1_nacos_service_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_mesh_v1alpha1_nacos_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_mesh_v1alpha1_nacos_service_proto_goTypes, + DependencyIndexes: file_api_mesh_v1alpha1_nacos_service_proto_depIdxs, + MessageInfos: file_api_mesh_v1alpha1_nacos_service_proto_msgTypes, + }.Build() + File_api_mesh_v1alpha1_nacos_service_proto = out.File + file_api_mesh_v1alpha1_nacos_service_proto_rawDesc = nil + file_api_mesh_v1alpha1_nacos_service_proto_goTypes = nil + file_api_mesh_v1alpha1_nacos_service_proto_depIdxs = nil +} diff --git a/api/mesh/v1alpha1/nacos_service.proto b/api/mesh/v1alpha1/nacos_service.proto new file mode 100644 index 000000000..71316ba18 --- /dev/null +++ b/api/mesh/v1alpha1/nacos_service.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package dubbo.mesh.v1alpha1; + +option go_package = "github.com/apache/dubbo-admin/api/mesh/v1alpha1"; + +import "api/mesh/options.proto"; + +// Nacos Service is the raw data of nacos service +message NacosService { + option (dubbo.mesh.resource).name = "NacosService"; + option (dubbo.mesh.resource).plural_name = "NacosService"; + option (dubbo.mesh.resource).package = "mesh"; + option (dubbo.mesh.resource).is_experimental = true; + + string serviceKey = 1; + + repeated NacosInstance instances = 3; +} + +message NacosInstance{ + + string ip = 1; + + int64 port = 2; + + map metadata = 3; +} \ No newline at end of file diff --git a/api/mesh/v1alpha1/runtime_instance.pb.go b/api/mesh/v1alpha1/runtime_instance.pb.go index 9f6443c87..4946d511d 100644 --- a/api/mesh/v1alpha1/runtime_instance.pb.go +++ b/api/mesh/v1alpha1/runtime_instance.pb.go @@ -32,16 +32,15 @@ type RuntimeInstance struct { RpcPort int64 `protobuf:"varint,3,opt,name=rpcPort,proto3" json:"rpcPort,omitempty"` Image string `protobuf:"bytes,4,opt,name=image,proto3" json:"image,omitempty"` AppName string `protobuf:"bytes,5,opt,name=appName,proto3" json:"appName,omitempty"` - Mesh string `protobuf:"bytes,6,opt,name=mesh,proto3" json:"mesh,omitempty"` - CreateTime string `protobuf:"bytes,7,opt,name=createTime,proto3" json:"createTime,omitempty"` - StartTime string `protobuf:"bytes,8,opt,name=startTime,proto3" json:"startTime,omitempty"` - ReadyTime string `protobuf:"bytes,9,opt,name=readyTime,proto3" json:"readyTime,omitempty"` - Phase string `protobuf:"bytes,10,opt,name=phase,proto3" json:"phase,omitempty"` - WorkloadName string `protobuf:"bytes,11,opt,name=workloadName,proto3" json:"workloadName,omitempty"` - WorkloadType string `protobuf:"bytes,12,opt,name=workloadType,proto3" json:"workloadType,omitempty"` - Node string `protobuf:"bytes,13,opt,name=node,proto3" json:"node,omitempty"` - Probes []*Probe `protobuf:"bytes,14,rep,name=probes,proto3" json:"probes,omitempty"` - Conditions []*Condition `protobuf:"bytes,15,rep,name=conditions,proto3" json:"conditions,omitempty"` + CreateTime string `protobuf:"bytes,6,opt,name=createTime,proto3" json:"createTime,omitempty"` + StartTime string `protobuf:"bytes,7,opt,name=startTime,proto3" json:"startTime,omitempty"` + ReadyTime string `protobuf:"bytes,8,opt,name=readyTime,proto3" json:"readyTime,omitempty"` + Phase string `protobuf:"bytes,9,opt,name=phase,proto3" json:"phase,omitempty"` + WorkloadName string `protobuf:"bytes,10,opt,name=workloadName,proto3" json:"workloadName,omitempty"` + WorkloadType string `protobuf:"bytes,11,opt,name=workloadType,proto3" json:"workloadType,omitempty"` + Node string `protobuf:"bytes,12,opt,name=node,proto3" json:"node,omitempty"` + Probes []*Probe `protobuf:"bytes,13,rep,name=probes,proto3" json:"probes,omitempty"` + Conditions []*Condition `protobuf:"bytes,14,rep,name=conditions,proto3" json:"conditions,omitempty"` // start from 50 for extra fields which is added by components in admin // sourceEngine is the engine name of runtime instance running on SourceEngine string `protobuf:"bytes,51,opt,name=sourceEngine,proto3" json:"sourceEngine,omitempty"` @@ -114,13 +113,6 @@ func (x *RuntimeInstance) GetAppName() string { return "" } -func (x *RuntimeInstance) GetMesh() string { - if x != nil { - return x.Mesh - } - return "" -} - func (x *RuntimeInstance) GetCreateTime() string { if x != nil { return x.CreateTime @@ -337,7 +329,7 @@ var file_api_mesh_v1alpha1_runtime_instance_proto_rawDesc = []byte{ 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x16, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x04, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x04, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, @@ -345,53 +337,52 @@ var file_api_mesh_v1alpha1_runtime_instance_proto_rawDesc = []byte{ 0x52, 0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x73, - 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x12, 0x1e, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, - 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x61, - 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x12, - 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x54, - 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, - 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x70, - 0x72, 0x6f, 0x62, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x75, - 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x73, 0x12, - 0x3e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x22, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, - 0x33, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x34, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3a, - 0x31, 0xaa, 0x8c, 0x89, 0xa6, 0x01, 0x2b, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, - 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, - 0x20, 0x01, 0x4a, 0x04, 0x08, 0x10, 0x10, 0x33, 0x22, 0x2f, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, - 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x79, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, + 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, + 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x22, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x62, 0x65, + 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x62, 0x65, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x63, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x33, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, + 0x2a, 0x0a, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x34, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x31, 0xaa, 0x8c, 0x89, + 0xa6, 0x01, 0x2b, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x04, 0x6d, 0x65, 0x73, 0x68, 0x20, 0x01, 0x4a, 0x04, + 0x08, 0x0f, 0x10, 0x33, 0x22, 0x2f, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6c, 0x61, 0x73, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x64, 0x75, 0x62, 0x62, 0x6f, 0x2d, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/mesh/v1alpha1/traffic_helper.go b/api/mesh/v1alpha1/traffic_helper.go index b62317f9f..7d72da007 100644 --- a/api/mesh/v1alpha1/traffic_helper.go +++ b/api/mesh/v1alpha1/traffic_helper.go @@ -20,8 +20,9 @@ package v1alpha1 import ( "strings" - "github.com/apache/dubbo-admin/pkg/core/consts" "github.com/dubbogo/gost/encoding/yaml" + + "github.com/apache/dubbo-admin/pkg/common/constants" ) const ( @@ -46,18 +47,18 @@ func BuildServiceKey(baseDto Base) string { return baseDto.Application } // id format: "${class}:${version}:${group}" - return baseDto.Service + consts.Colon + baseDto.ServiceVersion + consts.Colon + baseDto.ServiceGroup + return baseDto.Service + constants.ColonSeparator + baseDto.ServiceVersion + constants.ColonSeparator + baseDto.ServiceGroup } func GetRoutePath(key string, routeType string) string { key = strings.ReplaceAll(key, "/", "*") switch routeType { - case consts.ConditionRoute: - return key + consts.ConditionRuleSuffix - case consts.TagRoute: - return key + consts.TagRuleSuffix - case consts.AffinityRoute: - return key + consts.AffinityRuleSuffix + case constants.ConditionRoute: + return key + constants.ConditionRuleSuffix + case constants.TagRoute: + return key + constants.TagRuleSuffix + case constants.AffinityRoute: + return key + constants.AffinityRuleSuffix } return key + "." + routeType + "-router" } diff --git a/app/dubbo-admin/dubbo-admin.yaml b/app/dubbo-admin/dubbo-admin.yaml index 2455284dc..2af6a91f2 100644 --- a/app/dubbo-admin/dubbo-admin.yaml +++ b/app/dubbo-admin/dubbo-admin.yaml @@ -37,7 +37,9 @@ console: password: dubbo@2025 expirationTime: 3600 store: - type: memory +# type: memory + type: mysql + address: root:123456@tcp(127.0.0.1:3306)/dubbo-admin?charset=utf8mb4&parseTime=True&loc=Asia%2FShanghai discovery: - type: nacos2 name: localhost-nacos @@ -63,6 +65,8 @@ discovery: - type: mock name: mockRegistry engine: +# name: mock +# type: mock name: k8s1.28.6 type: kubernetes properties: @@ -116,7 +120,7 @@ engine: # e.g. # type: ByAnnotation # annotationKey: org.apache.dubbo/main-container-name=${app-name} - mainContainerChooseStrategy: - type: ByIndex - index: 0 +# mainContainerChooseStrategy: +# type: ByIndex +# index: 0 controlPlane: \ No newline at end of file diff --git a/go.mod b/go.mod index 327fdfa46..1075fb21a 100644 --- a/go.mod +++ b/go.mod @@ -25,11 +25,12 @@ require ( github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 github.com/dubbogo/gost v1.14.0 github.com/duke-git/lancet/v2 v2.3.6 - github.com/emicklei/go-restful/v3 v3.11.0 + github.com/emicklei/go-restful/v3 v3.12.2 github.com/envoyproxy/go-control-plane v0.13.4 github.com/envoyproxy/go-control-plane/envoy v1.32.4 github.com/fullstorydev/grpcurl v1.9.1 github.com/gin-contrib/sessions v1.0.4 + github.com/gin-contrib/zap v1.1.6 github.com/gin-gonic/gin v1.10.1 github.com/go-co-op/gocron v1.9.0 github.com/go-logr/logr v1.4.2 @@ -63,16 +64,16 @@ require ( gorm.io/driver/postgres v1.6.0 gorm.io/driver/sqlite v1.5.7 gorm.io/gorm v1.30.0 - k8s.io/api v0.32.0 - k8s.io/apimachinery v0.32.0 - k8s.io/client-go v0.32.0 + k8s.io/api v0.34.2 + k8s.io/apimachinery v0.34.2 + k8s.io/client-go v0.34.2 k8s.io/klog/v2 v2.130.1 + moul.io/zapgorm2 v1.3.0 sigs.k8s.io/controller-runtime v0.19.4 - sigs.k8s.io/yaml v1.4.0 + sigs.k8s.io/yaml v1.6.0 ) require ( - github.com/RoaringBitmap/roaring v1.2.3 // indirect github.com/Workiva/go-datastructures v1.0.52 // indirect github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.6 // indirect github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect @@ -95,37 +96,21 @@ require ( github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.8 // indirect github.com/aliyun/aliyun-secretsmanager-client-go v1.1.5 // indirect github.com/aliyun/credentials-go v1.4.3 // indirect - github.com/apache/dubbo-go-hessian2 v1.12.5 // indirect - github.com/bits-and-blooms/bitset v1.2.0 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/clbanning/mxj/v2 v2.5.5 // indirect - github.com/creasty/defaults v1.5.2 // indirect github.com/deckarep/golang-set v1.7.1 // indirect - github.com/dubbogo/grpc-go v1.42.10 // indirect - github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/mock v1.6.0 // indirect - github.com/influxdata/tdigest v0.0.1 // indirect github.com/jinzhu/copier v0.3.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/magiconair/properties v1.8.5 // indirect - github.com/mschoch/smat v0.2.0 // indirect github.com/natefinch/lumberjack v2.0.0+incompatible // indirect github.com/orcaman/concurrent-map v0.0.0-20210501183033-44dafcb38ecc // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/tjfoc/gmsm v1.4.1 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/contrib/propagators/b3 v1.10.0 // indirect - go.opentelemetry.io/otel v1.35.0 // indirect - go.opentelemetry.io/otel/metric v1.35.0 // indirect - go.opentelemetry.io/otel/sdk v1.35.0 // indirect - go.opentelemetry.io/otel/trace v1.35.0 // indirect - go.uber.org/atomic v1.10.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) require ( cel.dev/expr v0.23.0 // indirect - cloud.google.com/go/compute/metadata v0.6.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bufbuild/protocompile v0.10.0 // indirect @@ -137,10 +122,9 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 // indirect github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect - github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect github.com/gin-contrib/sse v1.1.0 // indirect - github.com/gin-contrib/zap v1.1.6 // indirect github.com/go-jose/go-jose/v4 v4.0.5 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect @@ -152,8 +136,7 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/goccy/go-json v0.10.5 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/gnostic-models v0.6.9 // indirect - github.com/google/gofuzz v1.2.0 // indirect + github.com/google/gnostic-models v0.7.0 // indirect github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect github.com/gorilla/context v1.1.2 // indirect github.com/gorilla/securecookie v1.1.2 // indirect @@ -173,7 +156,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect @@ -181,19 +164,21 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.57.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/pflag v1.0.6 // indirect github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/zeebo/errs v1.4.0 // indirect + go.yaml.in/yaml/v2 v2.4.2 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/arch v0.16.0 // indirect golang.org/x/crypto v0.45.0 // indirect golang.org/x/net v0.47.0 // indirect golang.org/x/oauth2 v0.28.0 // indirect golang.org/x/sync v0.18.0 // indirect golang.org/x/term v0.37.0 // indirect - golang.org/x/time v0.7.0 // indirect + golang.org/x/time v0.9.0 // indirect golang.org/x/tools v0.38.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect @@ -201,10 +186,11 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect - k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect - sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect + k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect + k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect + sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect ) replace ( diff --git a/go.sum b/go.sum index 296030c09..63be29d46 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,6 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= -cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= @@ -38,23 +36,17 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dubbo.apache.org/dubbo-go/v3 v3.3.0 h1:jhwK4nQ1DsKQ6H9p7icZx0jg9ulF1vpAA/c0Ly8Et4w= dubbo.apache.org/dubbo-go/v3 v3.3.0/go.mod h1:zu2m9tUGaZYfuaMX82pLlwmq7Vl4s5eenZNBGdfAagc= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/RoaringBitmap/roaring v1.2.3 h1:yqreLINqIrX22ErkKI0vY47/ivtJr6n+kMhVOVmhWBY= -github.com/RoaringBitmap/roaring v1.2.3/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI= github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -107,7 +99,6 @@ github.com/alibabacloud-go/tea-utils/v2 v2.0.7 h1:WDx5qW3Xa5ZgJ1c8NfqJkF6w+AU5wB github.com/alibabacloud-go/tea-utils/v2 v2.0.7/go.mod h1:qxn986l+q33J5VkialKMqT/TTs3E+U9MJpd001iWQ9I= github.com/alibabacloud-go/tea-xml v1.1.3 h1:7LYnm+JbOq2B+T/B0fHC4Ies4/FofC4zHzYtqw7dgt0= github.com/alibabacloud-go/tea-xml v1.1.3/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= -github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1800 h1:ie/8RxBOfKZWcrbYSJi2Z8uX8TcOlSMwPlEJh83OeOw= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1800/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU= @@ -124,33 +115,20 @@ github.com/aliyun/credentials-go v1.3.10/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPT github.com/aliyun/credentials-go v1.4.3 h1:N3iHyvHRMyOwY1+0qBLSf3hb5JFiOujVSVuEpgeGttY= github.com/aliyun/credentials-go v1.4.3/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/dubbo-go-hessian2 v1.9.1/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= -github.com/apache/dubbo-go-hessian2 v1.9.3/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= -github.com/apache/dubbo-go-hessian2 v1.12.5 h1:19lJz2Md0EYF2bOtEvFqXEQRYvLz04GfsoocsBWlLWQ= -github.com/apache/dubbo-go-hessian2 v1.12.5/go.mod h1:QP9Tc0w/B/mDopjusebo/c7GgEfl6Lz8jeuFg8JA6yw= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bufbuild/protocompile v0.10.0 h1:+jW/wnLMLxaCEG8AX9lD0bQ5v9h1RUiMKOBOT5ll9dM= github.com/bufbuild/protocompile v0.10.0/go.mod h1:G9qQIQo0xZ6Uyj6CMNz0saGmx2so+KONo8/KrELABiY= -github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bytedance/sonic v1.13.2 h1:8/H1FempDZqC4VqjptGo14QQlJx8VdZJegxs6wwfqpQ= @@ -158,8 +136,6 @@ github.com/bytedance/sonic v1.13.2/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1 github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -172,7 +148,6 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E= github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= @@ -180,36 +155,24 @@ github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -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-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f h1:C5bqEmzEPLsHm9Mv73lSE9e9bKV23aB1vxOsmZrkl3k= github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creasty/defaults v1.5.2 h1:/VfB6uxpyp6h0fr7SPp7n8WJBoV8jfxQXPCnkVSjyls= -github.com/creasty/defaults v1.5.2/go.mod h1:FPZ+Y0WNrbqOVw+c6av63eyHUAl6pMHZwqLPvXUZGfY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -218,35 +181,18 @@ github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9r github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= -github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= -github.com/dubbogo/gost v1.11.18/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= -github.com/dubbogo/gost v1.13.1/go.mod h1:9HMXBv+WBMRWhF3SklpqDjkS/01AKWm2SrVdz/A0xJI= github.com/dubbogo/gost v1.14.0 h1:yc5YfozvUBAChAox8H7CkmHb6/TvF6cKdqZNJNv2jdE= github.com/dubbogo/gost v1.14.0/go.mod h1:YP28JweR+hhJdikP3bZ3bVKUWWI313xX1rgLaEE0FvQ= -github.com/dubbogo/grpc-go v1.42.10 h1:CoyCdtqKJEar/3rPa6peZbDqYZ/mVsCqAxB6TfTSkhQ= -github.com/dubbogo/grpc-go v1.42.10/go.mod h1:JMkPt1mIHL96GAFeYsMoMjew6f1ROKycikGzZQH1s5U= -github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU= -github.com/dubbogo/net v0.0.4/go.mod h1:1CGOnM7X3he+qgGNqjeADuE5vKZQx/eMSeUkpU3ujIc= -github.com/dubbogo/triple v1.0.9/go.mod h1:1t9me4j4CTvNDcsMZy6/OGarbRyAUSY0tFXGXHCp7Iw= github.com/duke-git/lancet/v2 v2.3.6 h1:NKxSSh+dlgp37funvxLCf3xLBeUYa7VW1thYQP6j3Y8= github.com/duke-git/lancet/v2 v2.3.6/go.mod h1:zGa2R4xswg6EG9I6WnyubDbFO/+A/RROxIbXcwryTsc= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU= +github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/go-control-plane v0.13.4 h1:zEqyPVyku6IvWCFwux4x9RxkLOMUL+1vC9xUFv5l2/M= github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA= @@ -257,16 +203,13 @@ github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJP github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= -github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fullstorydev/grpcurl v1.9.1 h1:YxX1aCcCc4SDBQfj9uoWcTLe8t4NWrZe1y+mk83BQgo= github.com/fullstorydev/grpcurl v1.9.1/go.mod h1:i8gKLIC6s93WdU3LSmkE5vtsCxyRmihUj5FK1cNW5EM= -github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= -github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM= github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= @@ -281,7 +224,6 @@ github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ= github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= github.com/go-co-op/gocron v1.9.0 h1:+V+DDenw3ryB7B+tK1bAIC5p0ruw4oX9IqAsdRnGIf0= github.com/go-co-op/gocron v1.9.0/go.mod h1:DbJm9kdgr1sEvWpHCA7dFFs/PGHPMil9/97EXCRPr4k= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -289,19 +231,16 @@ github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3 github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= -github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= @@ -317,7 +256,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k= github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= @@ -326,17 +266,13 @@ github.com/goburrow/cache v0.1.4/go.mod h1:cDFesZDnIlrHoNlMYqqMpCRawuXulgx+y7mXU github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -368,11 +304,10 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= -github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= +github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo= +github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -384,7 +319,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -402,40 +336,30 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/context v1.1.2 h1:WRkNAv2uoa03QNIc1A6u4O7DAGMUVoopZhkiXWA2V1o= github.com/gorilla/context v1.1.2/go.mod h1:KDPwT9i/MeWHiLl90fuTgrt4/wPcv75vFAZLaOOcbxM= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.4.0 h1:kpIYOp/oi6MG/p5PgxApU8srsSw9tuFbt46Lt7auzqQ= github.com/gorilla/sessions v1.4.0/go.mod h1:FLWm50oby91+hl7p/wRxDth9bWSuk0qVL2emc7lT5ik= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -446,7 +370,6 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -457,20 +380,27 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hoisie/mustache v0.0.0-20160804235033-6375acf62c69 h1:umaj0TCQ9lWUUKy2DxAhEzPbwd0jnxiw1EI2z3FiILM= github.com/hoisie/mustache v0.0.0-20160804235033-6375acf62c69/go.mod h1:zdLK9ilQRSMjSeLKoZ4BqUfBT7jswTGF8zRlKEsiRXA= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/tdigest v0.0.1 h1:XpFptwYmnEKUqmkcDjrzffswZ3nvNeevbUSLPP/ZzIY= -github.com/influxdata/tdigest v0.0.1/go.mod h1:Z0kXnxzbTC2qrx4NaIzYkE1k66+6oEDQTvL95hQFh5Y= -github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.6.0 h1:SWJzexBzPL5jb0GEsrPMLIsi/3jOo7RHlzTjcAeDrPY= +github.com/jackc/pgx/v5 v5.6.0/go.mod h1:DNZ/vlrUnhWCoFGxHAG8U2ljioxukquj7utPDgtQdTw= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jhump/protoreflect v1.16.0 h1:54fZg+49widqXYQ0b+usAFHbMkBGR4PpXrsHc8+TBDg= github.com/jhump/protoreflect v1.16.0/go.mod h1:oYPd7nPvcBw/5wlDfm/AVmU9zH9BgqGCI469pGxfj/8= github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -483,8 +413,6 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -522,27 +450,17 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE= -github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8= -github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -560,65 +478,35 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= -github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nacos-group/nacos-sdk-go v1.0.8/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= -github.com/nacos-group/nacos-sdk-go/v2 v2.1.2/go.mod h1:ys/1adWeKXXzbNWfRNbaFlX/t6HVLWdpsNDvmoWTw0g= github.com/nacos-group/nacos-sdk-go/v2 v2.2.2/go.mod h1:ys/1adWeKXXzbNWfRNbaFlX/t6HVLWdpsNDvmoWTw0g= github.com/nacos-group/nacos-sdk-go/v2 v2.3.5 h1:Hux7C4N4rWhwBF5Zm4yyYskrs9VTgrRTA8DZjoEhQTs= github.com/nacos-group/nacos-sdk-go/v2 v2.3.5/go.mod h1:ygUBdt7eGeYBt6Lz2HO3wx7crKXk25Mp80568emGMWU= github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo/v2 v2.22.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM= github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/orcaman/concurrent-map v0.0.0-20210501183033-44dafcb38ecc h1:Ak86L+yDSOzKFa7WM5bf5itSOo1e3Xh8bm5YCMUXIjQ= github.com/orcaman/concurrent-map v0.0.0-20210501183033-44dafcb38ecc/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -627,39 +515,30 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY= github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= @@ -670,7 +549,6 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -681,9 +559,7 @@ github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWN github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shirou/gopsutil v3.20.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.22.2/go.mod h1:WapW1AOOPlHyXr+yOyw3uYx36enocrtSoSBy0L5vUHY= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -694,29 +570,23 @@ github.com/slok/go-http-metrics v0.11.0 h1:ABJUpekCZSkQT1wQrFvS4kGbhea/w6ndFJaWJ github.com/slok/go-http-metrics v0.11.0/go.mod h1:ZGKeYG1ET6TEJpQx18BqAJAvxw9jBAZXCHU7bWQqqAc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5-0.20210205191134-5ec6847320e5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spiffe/go-spiffe/v2 v2.5.0 h1:N2I01KCUkv1FAjZXJMwh95KK1ZIQLYbPfhaxw8WS0hE= github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -735,7 +605,6 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho= github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE= @@ -743,19 +612,12 @@ github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3/go.mod h1:QDlpd3qS71vYtakd2hmdpqhJ9nwv6mD6A30bQ1BPBFE= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= -github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -770,17 +632,13 @@ github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM= github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0-alpha.0/go.mod h1:mPcW6aZJukV6Aa81LSKpBjQXTWlXB5r74ymPoSWa3Sw= go.etcd.io/etcd/client/v2 v2.305.0-alpha.0/go.mod h1:kdV+xzCJ3luEBSIeQyB/OEKkWKd8Zkux4sbDeANrosU= go.etcd.io/etcd/client/v3 v3.5.0-alpha.0/go.mod h1:wKt7jgDgf/OfKiYmCq5WFGxOFAkVMLxiiXgLDFhECr8= go.etcd.io/etcd/pkg/v3 v3.5.0-alpha.0/go.mod h1:tV31atvwzcybuqejDoY3oaNRTtlD2l/Ot78Pc9w7DMY= go.etcd.io/etcd/raft/v3 v3.5.0-alpha.0/go.mod h1:FAwse6Zlm5v4tEWZaTjmNhe17Int4Oxbu7+2r0DiD3w= go.etcd.io/etcd/server/v3 v3.5.0-alpha.0/go.mod h1:tsKetYpt980ZTpzl/gb+UOJj9RkIyCb1u4wjzMg90BQ= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -788,8 +646,6 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib/propagators/b3 v1.10.0 h1:6AD2VV8edRdEYNaD8cNckpzgdMLU2kbV9OYyxt2kvCg= -go.opentelemetry.io/contrib/propagators/b3 v1.10.0/go.mod h1:oxvamQ/mTDFQVugml/uFS59+aEUnFLhmd1wsG+n5MOE= go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= @@ -801,31 +657,29 @@ go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstF go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= +go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/arch v0.16.0 h1:foMtLTdyOmIniqWCHjY6+JxuC54XP1fDwx4N0ASyW+U= golang.org/x/arch v0.16.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -833,7 +687,6 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -848,7 +701,6 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -887,13 +739,11 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -904,7 +754,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -927,7 +776,6 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211105192438-b53810dc28af/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= @@ -945,7 +793,6 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc= golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -966,11 +813,9 @@ golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -980,16 +825,13 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1010,8 +852,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201223074533-0d417f636930/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1021,7 +861,6 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211106132015-ebca88c72f68/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1053,7 +892,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -1063,18 +901,14 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= -golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1102,7 +936,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1135,10 +968,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca h1:PupagGYwj8+I4ubCxcmcBRk3VlUWtTg5huQpZR9flmE= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1156,7 +985,6 @@ google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -1167,7 +995,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1193,23 +1020,15 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210106152847-07624b53cd92/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 h1:hE3bRWtU6uceqlh4fhrSnUyjKHMKB9KrTLLG+bc0ddM= google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463/go.mod h1:U90ffi8eUL9MwPcrJylN5+Mk2v3vuPDptd5yyNUiRR8= google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1221,7 +1040,6 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= @@ -1248,15 +1066,11 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -1266,8 +1080,6 @@ gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24 gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1282,8 +1094,15 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +gorm.io/driver/mysql v1.6.0 h1:eNbLmNTpPpTOVZi8MMxCi2aaIm0ZpInbORNXDwyLGvg= +gorm.io/driver/mysql v1.6.0/go.mod h1:D/oCC2GWK3M/dqoLxnOlaNKmXz8WNTfcS9y5ovaSqKo= +gorm.io/driver/postgres v1.6.0 h1:2dxzU8xJ+ivvqTRph34QX+WrRaJlmfyPqXmoGVjMBa4= +gorm.io/driver/postgres v1.6.0/go.mod h1:vUw0mrGgrTK+uPHEhAdV4sfFELrByKVGnaVRkXDhtWo= +gorm.io/driver/sqlite v1.5.7 h1:8NvsrhP0ifM7LX9G4zPB97NwovUakUxc+2V2uuf3Z1I= +gorm.io/driver/sqlite v1.5.7/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDah4= +gorm.io/gorm v1.23.6/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.30.0 h1:qbT5aPv1UH8gI99OsRlvDToLxW5zR7FzS9acZDOZcgs= +gorm.io/gorm v1.30.0/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1291,30 +1110,32 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.32.0 h1:OL9JpbvAU5ny9ga2fb24X8H6xQlVp+aJMFlgtQjR9CE= -k8s.io/api v0.32.0/go.mod h1:4LEwHZEf6Q/cG96F3dqR965sYOfmPM7rq81BLgsE0p0= -k8s.io/apimachinery v0.32.0 h1:cFSE7N3rmEEtv4ei5X6DaJPHHX0C+upp+v5lVPiEwpg= -k8s.io/apimachinery v0.32.0/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/client-go v0.32.0 h1:DimtMcnN/JIKZcrSrstiwvvZvLjG0aSxy8PxN8IChp8= -k8s.io/client-go v0.32.0/go.mod h1:boDWvdM1Drk4NJj/VddSLnx59X3OPgwrOo0vGbtq9+8= +k8s.io/api v0.34.2 h1:fsSUNZhV+bnL6Aqrp6O7lMTy6o5x2C4XLjnh//8SLYY= +k8s.io/api v0.34.2/go.mod h1:MMBPaWlED2a8w4RSeanD76f7opUoypY8TFYkSM+3XHw= +k8s.io/apimachinery v0.34.2 h1:zQ12Uk3eMHPxrsbUJgNF8bTauTVR2WgqJsTmwTE/NW4= +k8s.io/apimachinery v0.34.2/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw= +k8s.io/client-go v0.34.2 h1:Co6XiknN+uUZqiddlfAjT68184/37PS4QAzYvQvDR8M= +k8s.io/client-go v0.34.2/go.mod h1:2VYDl1XXJsdcAxw7BenFslRQX28Dxz91U9MWKjX97fE= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= -k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOPolHyvO06MXG5TUIj2mNAA= +k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts= +k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y= +k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +moul.io/zapgorm2 v1.3.0 h1:+CzUTMIcnafd0d/BvBce8T4uPn6DQnpIrz64cyixlkk= +moul.io/zapgorm2 v1.3.0/go.mod h1:nPVy6U9goFKHR4s+zfSo1xVFaoU7Qgd5DoCdOfzoCqs= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/controller-runtime v0.19.4 h1:SUmheabttt0nx8uJtoII4oIP27BVVvAKFvdvGFwV/Qo= sigs.k8s.io/controller-runtime v0.19.4/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco= +sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= -sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/pkg/common/constants/common.go b/pkg/common/constants/common.go new file mode 100644 index 000000000..8ae854bc3 --- /dev/null +++ b/pkg/common/constants/common.go @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package constants + +const ( + TimeFormatStr = "2006-01-02 15:04:05" +) + +const ( + PathSeparator = "/" + DotSeparator = "." + ColonSeparator = ":" + CommaSeparator = "," + InterrogationPoint = "?" + IP = "ip" + PlusSigns = "+" + PunctuationPoint = "." + WildcardCharacter = "*" +) + +const ( + DefaultMesh = "default" +) diff --git a/pkg/common/constants/constants.go b/pkg/common/constants/constants.go index bed5214f9..005584412 100644 --- a/pkg/common/constants/constants.go +++ b/pkg/common/constants/constants.go @@ -17,7 +17,12 @@ package constants -// Registry Constants +const ( + DubboPropertyKey = "dubbo.properties" + RegistryAddressKey = "dubbo.registry.address" + MetadataReportAddressKey = "dubbo.metadata-report.address" +) + const ( RegistryKey = "registry" RegistryClusterKey = "REGISTRY_CLUSTER" @@ -27,55 +32,66 @@ const ( DefaultRegisterModeInterface = "interface" DefaultRegisterModeInstance = "instance" DefaultRegisterModeAll = "all" - VersionKey = "version" - GroupKey = "group" MetadataStorageTypeKey = "dubbo.metadata.storage-type" TimestampKey = "timestamp" EndpointsKey = "dubbo.endpoints" - InterfaceKey = "interface" URLParamsKey = "dubbo.metadata-service.url-params" MetadataRevisionKey = "dubbo.metadata.revision" -) - -const ( - SerializationKey = "prefer.serialization" -) - -const ( - DubboVersionKey = "dubbo" - WorkLoadKey = "workLoad" - ReleaseKey = "release" -) - -const ( - ServiceInfoSide = "side" - ProviderSide = "provider" - ConsumerSide = "consumer" -) + AnyValue = "*" + AnyHostValue = "0.0.0.0" + InterfaceKey = "interface" + GroupKey = "group" + VersionKey = "version" + ClassifierKey = "classifier" + CategoryKey = "category" + ProvidersCategory = "providers" + ConsumersCategory = "consumers" + RoutersCategory = "routers" + ConfiguratorsCategory = "configurators" + ConfiguratorRuleSuffix = ".configurators" + EnabledKey = "enabled" + CheckKey = "check" + AdminProtocol = "admin" + Side = "side" + ConsumerSide = "consumer" + ProviderSide = "provider" + ConsumerProtocol = "consumer" + EmptyProtocol = "empty" + OverrideProtocol = "override" + DefaultGroup = "dubbo" + DynamicKey = "dynamic" + SerializationKey = "serialization" + TimeoutKey = "timeout" + DefaultTimeout = 1000 + WeightKey = "weight" + BalancingKey = "balancing" + DefaultWeight = 100 + OwnerKey = "owner" -const ( - RetriesKey = "retries" - TimeoutKey = "timeout" + ConfigFileEnvKey = "conf" // config file path + RegistryAll = "ALL" + RegistryInterface = "INTERFACE" + RegistryInstance = "INSTANCE" + RegistryType = "TYPE" + NamespaceKey = "namespace" ) const ( Application = "application" Instance = "instance" Service = "service" -) -const ( - Stateful = "有状态" - Stateless = "无状态" + StatefulSet = "StatefulSet" + Deployment = "Deployment" ) const ( - PathSeparator = "/" - DotSeparator = "." - ColonSeparator = ":" - CommaSeparator = "," + DubboVersionKey = "dubbo" + WorkLoadKey = "workLoad" + ReleaseKey = "release" ) const ( - DefaultMesh = "default" + Stateful = "有状态" + Stateless = "无状态" ) diff --git a/pkg/common/constants/nacos.go b/pkg/common/constants/nacos.go new file mode 100644 index 000000000..29b22290b --- /dev/null +++ b/pkg/common/constants/nacos.go @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package constants + +const ( + NacosConfigGroup = "dubbo" + NacosMappingGroup = "mapping" +) + +// ServiceProviderNacosKey blur search service provider metadata +// "*:provider:*" +const ServiceProviderNacosKey = WildcardCharacter + ColonSeparator + ProviderSide + ColonSeparator + WildcardCharacter diff --git a/pkg/common/constants/rule.go b/pkg/common/constants/rule.go new file mode 100644 index 000000000..87e722cf8 --- /dev/null +++ b/pkg/common/constants/rule.go @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package constants + +const ( + ConfiguratorVersionV3 = `v3.0` + ConfiguratorVersionV3x1 = `v3.1` + ConfigVersionKey = `configVersion` + ScopeApplication = `application` + ScopeService = `service` + SideProvider = `provider` + SideConsumer = `consumer` + + ConditionRoute = "condition_route" + TagRoute = "tag_route" + AffinityRoute = "affinity_route" + ConditionRuleSuffix = ".condition-router" + TagRuleSuffix = ".tag-router" + AffinityRuleSuffix = ".affinity-router" +) + +const ( + NotEqual = "!=" + Equal = "=" +) diff --git a/pkg/config/engine/config.go b/pkg/config/engine/config.go index ecd90963f..e8769e0fa 100644 --- a/pkg/config/engine/config.go +++ b/pkg/config/engine/config.go @@ -24,6 +24,7 @@ type Type string const ( VM Type = "vm" Kubernetes Type = "kubernetes" + Mock Type = "mock" ) type Config struct { diff --git a/pkg/console/handler/condition_rule.go b/pkg/console/handler/condition_rule.go index 6e8eb44a1..cdc69e223 100644 --- a/pkg/console/handler/condition_rule.go +++ b/pkg/console/handler/condition_rule.go @@ -28,10 +28,10 @@ import ( "github.com/mitchellh/mapstructure" meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/common/constants" consolectx "github.com/apache/dubbo-admin/pkg/console/context" "github.com/apache/dubbo-admin/pkg/console/model" "github.com/apache/dubbo-admin/pkg/console/service" - "github.com/apache/dubbo-admin/pkg/core/consts" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" ) @@ -56,10 +56,10 @@ func GetConditionRuleWithRuleName(cs consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.ConditionRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.ConditionRuleSuffix)] + if strings.HasSuffix(ruleName, constants.ConditionRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.ConditionRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.ConditionRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.ConditionRuleSuffix))) return } if res, err := service.GetConditionRule(cs, name, mesh); err != nil { @@ -98,10 +98,10 @@ func PutConditionRuleWithRuleName(cs consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.ConditionRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.ConditionRuleSuffix)] + if strings.HasSuffix(ruleName, constants.ConditionRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.ConditionRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.ConditionRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.ConditionRuleSuffix))) return } _map, err := bodyToMap(c.Request.Body) @@ -111,7 +111,7 @@ func PutConditionRuleWithRuleName(cs consolectx.Context) gin.HandlerFunc { } res := meshresource.NewConditionRouteResourceWithAttributes(ruleName, mesh) - if version := _map[consts.ConfigVersionKey]; version == consts.ConfiguratorVersionV3 { + if version := _map[constants.ConfigVersionKey]; version == constants.ConfiguratorVersionV3 { v3 := new(meshproto.ConditionRouteV3) err = mapToStructure(_map, &v3) if err != nil { @@ -119,7 +119,7 @@ func PutConditionRuleWithRuleName(cs consolectx.Context) gin.HandlerFunc { return } res.Spec = v3.ToConditionRoute() - } else if version == consts.ConfiguratorVersionV3x1 { + } else if version == constants.ConfiguratorVersionV3x1 { v3x1 := new(meshproto.ConditionRouteV3X1) err = mapToStructure(_map, &v3x1) if err != nil { @@ -147,10 +147,10 @@ func PostConditionRuleWithRuleName(cs consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.ConditionRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.ConditionRuleSuffix)] + if strings.HasSuffix(ruleName, constants.ConditionRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.ConditionRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.ConditionRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.ConditionRuleSuffix))) return } _map, err := bodyToMap(c.Request.Body) @@ -161,7 +161,7 @@ func PostConditionRuleWithRuleName(cs consolectx.Context) gin.HandlerFunc { res := &meshresource.ConditionRouteResource{} res = meshresource.NewConditionRouteResourceWithAttributes(ruleName, mesh) - if version := _map[consts.ConfigVersionKey]; version == consts.ConfiguratorVersionV3 { + if version := _map[constants.ConfigVersionKey]; version == constants.ConfiguratorVersionV3 { v3 := new(meshproto.ConditionRouteV3) err = mapToStructure(_map, &v3) if err != nil { @@ -169,7 +169,7 @@ func PostConditionRuleWithRuleName(cs consolectx.Context) gin.HandlerFunc { return } res.Spec = v3.ToConditionRoute() - } else if version == consts.ConfiguratorVersionV3x1 { + } else if version == constants.ConfiguratorVersionV3x1 { v3x1 := new(meshproto.ConditionRouteV3X1) err = mapToStructure(_map, &v3x1) if err != nil { @@ -196,10 +196,10 @@ func DeleteConditionRuleWithRuleName(cs consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.ConditionRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.ConditionRuleSuffix)] + if strings.HasSuffix(ruleName, constants.ConditionRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.ConditionRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.ConditionRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.ConditionRuleSuffix))) return } if err := service.DeleteConditionRule(cs, name, mesh); err != nil { diff --git a/pkg/console/handler/configurator_rule.go b/pkg/console/handler/configurator_rule.go index 19280c5ea..e49e51d88 100644 --- a/pkg/console/handler/configurator_rule.go +++ b/pkg/console/handler/configurator_rule.go @@ -25,10 +25,10 @@ import ( "github.com/duke-git/lancet/v2/strutil" "github.com/gin-gonic/gin" + "github.com/apache/dubbo-admin/pkg/common/constants" consolectx "github.com/apache/dubbo-admin/pkg/console/context" "github.com/apache/dubbo-admin/pkg/console/model" "github.com/apache/dubbo-admin/pkg/console/service" - "github.com/apache/dubbo-admin/pkg/core/consts" "github.com/apache/dubbo-admin/pkg/core/manager" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" @@ -111,10 +111,10 @@ func PutConfiguratorWithRuleName(ctx consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.ConfiguratorRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.ConfiguratorRuleSuffix)] + if strings.HasSuffix(ruleName, constants.ConfiguratorRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.ConfiguratorRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.ConfiguratorRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.ConfiguratorRuleSuffix))) return } res := meshresource.NewDynamicConfigResourceWithAttributes(name, mesh) @@ -137,10 +137,10 @@ func PostConfiguratorWithRuleName(ctx consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.ConfiguratorRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.ConfiguratorRuleSuffix)] + if strings.HasSuffix(ruleName, constants.ConfiguratorRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.ConfiguratorRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.ConfiguratorRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.ConfiguratorRuleSuffix))) return } res := meshresource.NewDynamicConfigResourceWithAttributes(name, mesh) @@ -163,10 +163,10 @@ func DeleteConfiguratorWithRuleName(ctx consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.ConfiguratorRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.ConfiguratorRuleSuffix)] + if strings.HasSuffix(ruleName, constants.ConfiguratorRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.ConfiguratorRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.ConfiguratorRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.ConfiguratorRuleSuffix))) return } if err := service.DeleteConfigurator(ctx, name, mesh); err != nil { diff --git a/pkg/console/handler/instance.go b/pkg/console/handler/instance.go index 28c31b423..e45b9f5d7 100644 --- a/pkg/console/handler/instance.go +++ b/pkg/console/handler/instance.go @@ -27,10 +27,10 @@ import ( "github.com/pkg/errors" meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/common/constants" consolectx "github.com/apache/dubbo-admin/pkg/console/context" "github.com/apache/dubbo-admin/pkg/console/model" "github.com/apache/dubbo-admin/pkg/console/service" - "github.com/apache/dubbo-admin/pkg/core/consts" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" corestore "github.com/apache/dubbo-admin/pkg/core/store" ) @@ -102,7 +102,7 @@ func InstanceConfigTrafficDisableGET(ctx consolectx.Context) gin.HandlerFunc { return } - if res.Spec.GetVersion() != consts.ConfiguratorVersionV3 { + if res.Spec.GetVersion() != constants.ConfiguratorVersionV3 { c.JSON(http.StatusServiceUnavailable, model.NewErrorResp("this config only serve condition-route.configVersion == v3, got v3.1 config ")) return } @@ -197,7 +197,7 @@ func InstanceConfigTrafficDisablePUT(ctx consolectx.Context) gin.HandlerFunc { return } existRule = false - res = generateDefaultConditionV3(true, true, true, appName, consts.ScopeApplication) + res = generateDefaultConditionV3(true, true, true, appName, constants.ScopeApplication) rawRes = meshresource.NewConditionRouteResourceWithAttributes(appName, mesh) rawRes.Spec = res.ToConditionRoute() } else if res = rawRes.Spec.ToConditionRouteV3(); res == nil { @@ -263,7 +263,7 @@ func newDisableConditionV3(ip string) string { func generateDefaultConditionV3x1(Enabled, Force, Runtime bool, Key, Scope string) *meshproto.ConditionRouteV3X1 { return &meshproto.ConditionRouteV3X1{ - ConfigVersion: consts.ConfiguratorVersionV3x1, + ConfigVersion: constants.ConfiguratorVersionV3x1, Enabled: Enabled, Force: Force, Runtime: Runtime, @@ -275,7 +275,7 @@ func generateDefaultConditionV3x1(Enabled, Force, Runtime bool, Key, Scope strin func generateDefaultConditionV3(Enabled, Force, Runtime bool, Key, Scope string) *meshproto.ConditionRouteV3 { return &meshproto.ConditionRouteV3{ - ConfigVersion: consts.ConfiguratorVersionV3, + ConfigVersion: constants.ConfiguratorVersionV3, Priority: 0, Enabled: true, Force: Force, @@ -306,7 +306,7 @@ func InstanceConfigOperatorLogGET(ctx consolectx.Context) gin.HandlerFunc { c.JSON(http.StatusBadRequest, model.NewErrorResp("mesh is empty")) return } - appConfiguratorName := applicationName + consts.ConfiguratorRuleSuffix + appConfiguratorName := applicationName + constants.ConfiguratorRuleSuffix res, err := service.GetConfigurator(ctx, appConfiguratorName, mesh) if err != nil { if corestore.IsResourceNotFound(err) { @@ -333,7 +333,7 @@ func isInstanceOperatorLogOpen(conf *meshproto.OverrideConfig, IP string) bool { conf.Match != nil && conf.Match.Address != nil && conf.Match.Address.Wildcard == IP+`:*` && - conf.Side == consts.SideProvider && + conf.Side == constants.SideProvider && conf.Parameters != nil && conf.Parameters[`accesslog`] == `true` { return true @@ -363,7 +363,7 @@ func InstanceConfigOperatorLogPUT(ctx consolectx.Context) gin.HandlerFunc { c.JSON(http.StatusBadRequest, model.NewErrorResp("mesh is empty")) return } - appConfiguratorName := applicationName + consts.ConfiguratorRuleSuffix + appConfiguratorName := applicationName + constants.ConfiguratorRuleSuffix res, err := service.GetConfigurator(ctx, appConfiguratorName, mesh) notExist := false if err != nil { @@ -374,8 +374,8 @@ func InstanceConfigOperatorLogPUT(ctx consolectx.Context) gin.HandlerFunc { res = meshresource.NewDynamicConfigResourceWithAttributes(appConfiguratorName, mesh) res.Spec = &meshproto.DynamicConfig{ Key: applicationName, - Scope: consts.ScopeApplication, - ConfigVersion: consts.ConfiguratorVersionV3, + Scope: constants.ScopeApplication, + ConfigVersion: constants.ConfiguratorVersionV3, Enabled: true, Configs: make([]*meshproto.OverrideConfig, 0), } @@ -394,7 +394,7 @@ func InstanceConfigOperatorLogPUT(ctx consolectx.Context) gin.HandlerFunc { }) if !isExist { res.Spec.Configs = append(res.Spec.Configs, &meshproto.OverrideConfig{ - Side: consts.SideProvider, + Side: constants.SideProvider, Match: &meshproto.ConditionMatch{Address: &meshproto.AddressMatch{Wildcard: instanceIP + `:*`}}, Parameters: map[string]string{`accesslog`: `true`}, XGenerateByCp: true, diff --git a/pkg/console/handler/service.go b/pkg/console/handler/service.go index 5f19f183e..32ce2df95 100644 --- a/pkg/console/handler/service.go +++ b/pkg/console/handler/service.go @@ -24,10 +24,10 @@ import ( "github.com/gin-gonic/gin" meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/common/constants" consolectx "github.com/apache/dubbo-admin/pkg/console/context" "github.com/apache/dubbo-admin/pkg/console/model" "github.com/apache/dubbo-admin/pkg/console/service" - "github.com/apache/dubbo-admin/pkg/core/consts" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" corestore "github.com/apache/dubbo-admin/pkg/core/store" ) @@ -107,7 +107,7 @@ func ServiceConfigTimeoutGET(ctx consolectx.Context) gin.HandlerFunc { c.JSON(http.StatusBadRequest, model.NewErrorResp(err.Error())) return } - serviceConfiguratorName := param.ServiceKey() + consts.PunctuationPoint + consts.ConfiguratorRuleSuffix + serviceConfiguratorName := param.ServiceKey() + constants.PunctuationPoint + constants.ConfiguratorRuleSuffix res, err := service.GetConfigurator(ctx, serviceConfiguratorName, param.Mesh) if err != nil { if !corestore.IsResourceNotFound(err) { @@ -130,7 +130,7 @@ func ServiceConfigTimeoutGET(ctx consolectx.Context) gin.HandlerFunc { } func getServiceTimeout(conf *meshproto.OverrideConfig) (int32, bool) { - if conf.Side == consts.SideProvider && conf.Parameters != nil && conf.Parameters[`timeout`] != "" { + if conf.Side == constants.SideProvider && conf.Parameters != nil && conf.Parameters[`timeout`] != "" { timeout, err := strconv.Atoi(conf.Parameters[`timeout`]) if err == nil { return int32(timeout), true @@ -151,7 +151,7 @@ func ServiceConfigTimeoutPUT(ctx consolectx.Context) gin.HandlerFunc { } isExist := true - serviceConfiguratorName := param.ServiceKey() + consts.PunctuationPoint + consts.ConfiguratorRuleSuffix + serviceConfiguratorName := param.ServiceKey() + constants.PunctuationPoint + constants.ConfiguratorRuleSuffix res, err := service.GetConfigurator(ctx, serviceConfiguratorName, param.Mesh) if err != nil { if !corestore.IsResourceNotFound(err) { @@ -163,8 +163,8 @@ func ServiceConfigTimeoutPUT(ctx consolectx.Context) gin.HandlerFunc { res = meshresource.NewDynamicConfigResourceWithAttributes(serviceConfiguratorName, param.Mesh) res.Spec = &meshproto.DynamicConfig{ Key: param.ServiceName, - Scope: consts.ScopeService, - ConfigVersion: consts.ConfiguratorVersionV3, + Scope: constants.ScopeService, + ConfigVersion: constants.ConfiguratorVersionV3, Enabled: true, Configs: make([]*meshproto.OverrideConfig, 0), } @@ -181,7 +181,7 @@ func ServiceConfigTimeoutPUT(ctx consolectx.Context) gin.HandlerFunc { if !isExist { res.Spec.Configs = append(res.Spec.Configs, &meshproto.OverrideConfig{ - Side: consts.SideProvider, + Side: constants.SideProvider, Parameters: map[string]string{`timeout`: strconv.Itoa(int(param.Timeout))}, XGenerateByCp: true, }) @@ -211,7 +211,7 @@ func ServiceConfigRetryGET(ctx consolectx.Context) gin.HandlerFunc { c.JSON(http.StatusBadRequest, model.NewErrorResp(err.Error())) return } - serviceConfiguratorName := param.ServiceKey() + consts.PunctuationPoint + consts.ConfiguratorRuleSuffix + serviceConfiguratorName := param.ServiceKey() + constants.PunctuationPoint + constants.ConfiguratorRuleSuffix res, err := service.GetConfigurator(ctx, serviceConfiguratorName, param.Mesh) if err != nil { if !corestore.IsResourceNotFound(err) { @@ -234,7 +234,7 @@ func ServiceConfigRetryGET(ctx consolectx.Context) gin.HandlerFunc { } func getServiceRetryTimes(conf *meshproto.OverrideConfig) (int32, bool) { - if conf.Side == consts.SideConsumer && conf.Parameters != nil && conf.Parameters[`retries`] != "" { + if conf.Side == constants.SideConsumer && conf.Parameters != nil && conf.Parameters[`retries`] != "" { retries, err := strconv.Atoi(conf.Parameters[`retries`]) if err == nil { return int32(retries), true @@ -255,7 +255,7 @@ func ServiceConfigRetryPUT(ctx consolectx.Context) gin.HandlerFunc { } isExist := true - serviceConfiguratorName := param.ServiceKey() + consts.PunctuationPoint + consts.ConfiguratorRuleSuffix + serviceConfiguratorName := param.ServiceKey() + constants.PunctuationPoint + constants.ConfiguratorRuleSuffix res, err := service.GetConfigurator(ctx, serviceConfiguratorName, param.Mesh) if err != nil { if !corestore.IsResourceNotFound(err) { @@ -267,8 +267,8 @@ func ServiceConfigRetryPUT(ctx consolectx.Context) gin.HandlerFunc { res = meshresource.NewDynamicConfigResourceWithAttributes(serviceConfiguratorName, param.Mesh) res.Spec = &meshproto.DynamicConfig{ Key: param.ServiceName, - Scope: consts.ScopeService, - ConfigVersion: consts.ConfiguratorVersionV3, + Scope: constants.ScopeService, + ConfigVersion: constants.ConfiguratorVersionV3, Enabled: true, Configs: make([]*meshproto.OverrideConfig, 0), } @@ -281,7 +281,7 @@ func ServiceConfigRetryPUT(ctx consolectx.Context) gin.HandlerFunc { }) res.Spec.Configs = append(res.Spec.Configs, &meshproto.OverrideConfig{ - Side: consts.SideConsumer, + Side: constants.SideConsumer, Parameters: map[string]string{`retries`: strconv.Itoa(int(param.RetryTimes))}, XGenerateByCp: true, }) @@ -315,7 +315,7 @@ func ServiceConfigRegionPriorityGET(ctx consolectx.Context) gin.HandlerFunc { c.JSON(http.StatusBadRequest, model.NewErrorResp(err.Error())) return } - serviceAffinityRouteName := param.ServiceKey() + consts.PunctuationPoint + consts.AffinityRuleSuffix + serviceAffinityRouteName := param.ServiceKey() + constants.PunctuationPoint + constants.AffinityRuleSuffix res, err := service.GetAffinityRule(ctx, serviceAffinityRouteName, param.Mesh) if err != nil { if !corestore.IsResourceNotFound(err) { @@ -350,7 +350,7 @@ func ServiceConfigRegionPriorityPUT(ctx consolectx.Context) gin.HandlerFunc { } isExist := true - serviceAffinityRouteName := param.ServiceKey() + consts.PunctuationPoint + consts.AffinityRuleSuffix + serviceAffinityRouteName := param.ServiceKey() + constants.PunctuationPoint + constants.AffinityRuleSuffix res, err := service.GetAffinityRule(ctx, serviceAffinityRouteName, param.Mesh) if err != nil { if !corestore.IsResourceNotFound(err) { @@ -418,7 +418,7 @@ func ServiceConfigArgumentRouteGET(ctx consolectx.Context) gin.HandlerFunc { c.JSON(http.StatusBadRequest, model.NewErrorResp(err.Error())) return } - serviceConditionRuleName := param.ServiceKey() + consts.PunctuationPoint + consts.ConditionRuleSuffix + serviceConditionRuleName := param.ServiceKey() + constants.PunctuationPoint + constants.ConditionRuleSuffix rawRes, err := service.GetConditionRule(ctx, serviceConditionRuleName, param.Mesh) if err != nil { if !corestore.IsResourceNotFound(err) { @@ -458,7 +458,7 @@ func ServiceConfigArgumentRoutePUT(ctx consolectx.Context) gin.HandlerFunc { } isExist := true - serviceConditionRuleName := param.ServiceKey() + consts.PunctuationPoint + consts.ConditionRuleSuffix + serviceConditionRuleName := param.ServiceKey() + constants.PunctuationPoint + constants.ConditionRuleSuffix rawRes, err := service.GetConditionRule(ctx, serviceConditionRuleName, param.Mesh) if err != nil { if !corestore.IsResourceNotFound(err) { @@ -473,7 +473,7 @@ func ServiceConfigArgumentRoutePUT(ctx consolectx.Context) gin.HandlerFunc { false, true, param.ServiceName, - consts.ScopeService).ToConditionRoute() + constants.ScopeService).ToConditionRoute() isExist = false } diff --git a/pkg/console/handler/tag_rule.go b/pkg/console/handler/tag_rule.go index 7f5756fc6..55a543e0c 100644 --- a/pkg/console/handler/tag_rule.go +++ b/pkg/console/handler/tag_rule.go @@ -25,10 +25,10 @@ import ( "github.com/duke-git/lancet/v2/strutil" "github.com/gin-gonic/gin" + "github.com/apache/dubbo-admin/pkg/common/constants" consolectx "github.com/apache/dubbo-admin/pkg/console/context" "github.com/apache/dubbo-admin/pkg/console/model" "github.com/apache/dubbo-admin/pkg/console/service" - "github.com/apache/dubbo-admin/pkg/core/consts" "github.com/apache/dubbo-admin/pkg/core/manager" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" @@ -87,10 +87,10 @@ func GetTagRuleWithRuleName(ctx consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.TagRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.TagRuleSuffix)] + if strings.HasSuffix(ruleName, constants.TagRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.TagRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.TagRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.TagRuleSuffix))) return } if res, err := service.GetTagRule(ctx, name, mesh); err != nil { @@ -107,10 +107,10 @@ func PutTagRuleWithRuleName(ctx consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.TagRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.TagRuleSuffix)] + if strings.HasSuffix(ruleName, constants.TagRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.TagRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.TagRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.TagRuleSuffix))) return } res := meshresource.NewTagRouteResourceWithAttributes(name, mesh) @@ -133,10 +133,10 @@ func PostTagRuleWithRuleName(ctx consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.TagRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.TagRuleSuffix)] + if strings.HasSuffix(ruleName, constants.TagRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.TagRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.TagRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.TagRuleSuffix))) return } res := meshresource.NewTagRouteResourceWithAttributes(name, mesh) @@ -159,10 +159,10 @@ func DeleteTagRuleWithRuleName(ctx consolectx.Context) gin.HandlerFunc { var name string ruleName := c.Param("ruleName") mesh := c.Param("mesh") - if strings.HasSuffix(ruleName, consts.TagRuleSuffix) { - name = ruleName[:len(ruleName)-len(consts.TagRuleSuffix)] + if strings.HasSuffix(ruleName, constants.TagRuleSuffix) { + name = ruleName[:len(ruleName)-len(constants.TagRuleSuffix)] } else { - c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", consts.TagRuleSuffix))) + c.JSON(http.StatusBadRequest, model.NewErrorResp(fmt.Sprintf("ruleName must end with %s", constants.TagRuleSuffix))) return } if err := service.DeleteTagRule(ctx, name, mesh); err != nil { diff --git a/pkg/console/model/application.go b/pkg/console/model/application.go index 2d226032e..6da5939eb 100644 --- a/pkg/console/model/application.go +++ b/pkg/console/model/application.go @@ -18,8 +18,9 @@ package model import ( + "strconv" + "github.com/apache/dubbo-admin/pkg/common/constants" - "github.com/apache/dubbo-admin/pkg/core/consts" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" ) @@ -86,16 +87,16 @@ func NewApplicationDetail() *ApplicationDetail { } func (a *ApplicationDetail) MergeInstance(instanceRes *meshresource.InstanceResource) { instance := instanceRes.Spec - if instance.WorkloadType == consts.StatefulSet { + if instance.WorkloadType == constants.StatefulSet { a.AppTypes.Add(constants.Stateful) } else { a.AppTypes.Add(constants.Stateless) } - a.DubboPorts.Add(string(instance.RpcPort)) + a.DubboPorts.Add(strconv.FormatInt(instance.RpcPort, 10)) a.DubboVersions.Add(instance.ReleaseVersion) a.Images.Add(instance.Image) a.RegisterClusters.Add(instanceRes.Mesh) - a.RegisterModes.Add(consts.Application) + a.RegisterModes.Add(constants.Application) a.RPCProtocols.Add(instance.Protocol) a.SerialProtocols.Add(instance.Serialization) a.Workloads.Add(instance.WorkloadName) diff --git a/pkg/console/model/condition_rule.go b/pkg/console/model/condition_rule.go index 42bb6bc6b..a65cb8e0c 100644 --- a/pkg/console/model/condition_rule.go +++ b/pkg/console/model/condition_rule.go @@ -21,7 +21,7 @@ import ( "strings" meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" - "github.com/apache/dubbo-admin/pkg/core/consts" + "github.com/apache/dubbo-admin/pkg/common/constants" coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" ) @@ -105,10 +105,10 @@ type RouteCondition struct { } func (r *RouteCondition) string() string { - if r.Relation == consts.Equal { - return "arguments[" + r.Index + "]" + consts.Equal + r.Value + if r.Relation == constants.Equal { + return "arguments[" + r.Index + "]" + constants.Equal + r.Value } else { - return "arguments[" + r.Index + "]" + consts.NotEqual + r.Value + return "arguments[" + r.Index + "]" + constants.NotEqual + r.Value } } @@ -124,10 +124,10 @@ type DestinationCondition struct { } func (d *DestinationCondition) string() string { - if d.Relation == consts.Equal { - return d.Tag + consts.Equal + d.Value + if d.Relation == constants.Equal { + return d.Tag + constants.Equal + d.Value } else { - return d.Tag + consts.NotEqual + d.Value + return d.Tag + constants.NotEqual + d.Value } } @@ -168,17 +168,17 @@ func matchValueToRouteCondition(val string) []RouteCondition { subsets := strings.Split(val, "&") res := make([]RouteCondition, 0, len(subsets)) for _, subset := range subsets { - if index := strings.Index(subset, consts.NotEqual); index != -1 { + if index := strings.Index(subset, constants.NotEqual); index != -1 { res = append(res, RouteCondition{ Index: strings.Trim(subset[:index], " "), - Relation: consts.NotEqual, - Value: strings.Trim(subset[index+len(consts.NotEqual):], " "), + Relation: constants.NotEqual, + Value: strings.Trim(subset[index+len(constants.NotEqual):], " "), }) - } else if index := strings.Index(subset, consts.Equal); index != -1 { + } else if index := strings.Index(subset, constants.Equal); index != -1 { res = append(res, RouteCondition{ Index: strings.Trim(subset[:index], " "), - Relation: consts.Equal, - Value: strings.Trim(subset[index+len(consts.Equal):], " "), + Relation: constants.Equal, + Value: strings.Trim(subset[index+len(constants.Equal):], " "), }) } } @@ -189,17 +189,17 @@ func matchValueToDestinationCondition(val string) []DestinationCondition { subsets := strings.Split(val, "&") res := make([]DestinationCondition, 0, len(subsets)) for _, subset := range subsets { - if index := strings.Index(subset, consts.NotEqual); index != -1 { + if index := strings.Index(subset, constants.NotEqual); index != -1 { res = append(res, DestinationCondition{ Tag: strings.Trim(subset[:index], " "), - Relation: consts.NotEqual, - Value: strings.Trim(subset[index+len(consts.NotEqual):], " "), + Relation: constants.NotEqual, + Value: strings.Trim(subset[index+len(constants.NotEqual):], " "), }) - } else if index := strings.Index(subset, consts.Equal); index != -1 { + } else if index := strings.Index(subset, constants.Equal); index != -1 { res = append(res, DestinationCondition{ Tag: strings.Trim(subset[:index], " "), - Relation: consts.Equal, - Value: strings.Trim(subset[index+len(consts.Equal):], " "), + Relation: constants.Equal, + Value: strings.Trim(subset[index+len(constants.Equal):], " "), }) } } diff --git a/pkg/console/model/service.go b/pkg/console/model/service.go index ceb431b41..60324a99b 100644 --- a/pkg/console/model/service.go +++ b/pkg/console/model/service.go @@ -24,7 +24,7 @@ import ( "github.com/gin-gonic/gin" "github.com/apache/dubbo-admin/api/mesh/v1alpha1" - "github.com/apache/dubbo-admin/pkg/core/consts" + "github.com/apache/dubbo-admin/pkg/common/constants" coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" ) @@ -172,5 +172,5 @@ func (s *BaseServiceReq) Query(c *gin.Context) error { } func (s *BaseServiceReq) ServiceKey() string { - return s.ServiceName + consts.Colon + s.Group + consts.Colon + s.Version + return s.ServiceName + constants.ColonSeparator + s.Group + constants.ColonSeparator + s.Version } diff --git a/pkg/console/model/tag_rule.go b/pkg/console/model/tag_rule.go index 6890ef1f6..9428771ea 100644 --- a/pkg/console/model/tag_rule.go +++ b/pkg/console/model/tag_rule.go @@ -19,7 +19,7 @@ package model import ( meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" - "github.com/apache/dubbo-admin/pkg/core/consts" + "github.com/apache/dubbo-admin/pkg/common/constants" ) type TagRuleSearchResp struct { @@ -52,7 +52,7 @@ func GenTagRouteResp(pb *meshproto.TagRoute) *CommonResp { Enabled: pb.Enabled, Key: pb.Key, Runtime: pb.Runtime, - Scope: consts.ScopeApplication, + Scope: constants.ScopeApplication, Tags: tagToRespTagElement(pb.Tags), }) } diff --git a/pkg/console/service/application.go b/pkg/console/service/application.go index cf4656764..49dfd048b 100644 --- a/pkg/console/service/application.go +++ b/pkg/console/service/application.go @@ -27,9 +27,9 @@ import ( meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" consolectx "github.com/apache/dubbo-admin/pkg/console/context" "github.com/apache/dubbo-admin/pkg/console/model" - "github.com/apache/dubbo-admin/pkg/core/consts" "github.com/apache/dubbo-admin/pkg/core/logger" "github.com/apache/dubbo-admin/pkg/core/manager" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" @@ -110,7 +110,7 @@ func buildAppInstanceInfoResp(instanceRes *meshresource.InstanceResource) *model } func GetAppServiceInfo(ctx consolectx.Context, req *model.ApplicationServiceFormReq) (*model.SearchPaginationResult, error) { - if req.Side == consts.ConsumerSide { + if req.Side == constants.ConsumerSide { return getAppProvideServiceInfo(ctx, req) } else { return getAppConsumeServiceInfo(ctx, req) @@ -275,7 +275,7 @@ func buildApplicationSearchResp(appResource *meshresource.ApplicationResource, m } func isAppAccessLogConfig(conf *meshproto.OverrideConfig, appName string) bool { - if conf.Side != consts.SideProvider || + if conf.Side != constants.SideProvider || conf.Parameters == nil || conf.Match == nil || conf.Match.Application == nil || @@ -300,7 +300,7 @@ func UpInsertAppAccessLog(ctx consolectx.Context, appName string, openAccessLog return bizerror.New(bizerror.AppNotFound, fmt.Sprintf("%s does not exist", appName)) } // check app configurator exists - appConfiguratorName := appName + consts.ConfiguratorRuleSuffix + appConfiguratorName := appName + constants.ConfiguratorRuleSuffix res, err := GetConfigurator(ctx, appConfiguratorName, mesh) if err != nil { return err @@ -322,8 +322,8 @@ func insertConfiguratorWithAccessLog(ctx consolectx.Context, res *meshresource.D res = meshresource.NewDynamicConfigResourceWithAttributes(appConfiguratorName, mesh) res.Spec = &meshproto.DynamicConfig{ Key: appName, - Scope: consts.ScopeApplication, - ConfigVersion: consts.ConfiguratorVersionV3, + Scope: constants.ScopeApplication, + ConfigVersion: constants.ConfiguratorVersionV3, Enabled: true, Configs: make([]*meshproto.OverrideConfig, 0), } @@ -374,7 +374,7 @@ func updateConfiguratorWithAccessLog(ctx consolectx.Context, res *meshresource.D func newAccessLogEnabledConfig(appName string) *meshproto.OverrideConfig { return &meshproto.OverrideConfig{ - Side: consts.SideProvider, + Side: constants.SideProvider, Parameters: map[string]string{`accesslog`: `true`}, Enabled: true, Match: &meshproto.ConditionMatch{ @@ -389,7 +389,7 @@ func newAccessLogEnabledConfig(appName string) *meshproto.OverrideConfig { } func GetAppAccessLog(ctx consolectx.Context, appName string, mesh string) (*model.AppAccessLogConfigResp, error) { - appConfiguratorName := appName + consts.ConfiguratorRuleSuffix + appConfiguratorName := appName + constants.ConfiguratorRuleSuffix res, err := GetConfigurator(ctx, appConfiguratorName, mesh) resp := &model.AppAccessLogConfigResp{ AccessLog: false, @@ -421,7 +421,7 @@ func GetAppFlowWeight(ctx consolectx.Context, appName string, mesh string) (*mod resp := &model.AppFlowWeightConfigResp{ FlowWeightSets: []model.FlowWeightSet{}, } - appConfiguratorName := appName + consts.ConfiguratorRuleSuffix + appConfiguratorName := appName + constants.ConfiguratorRuleSuffix res, err := GetConfigurator(ctx, appConfiguratorName, mesh) if err != nil { logger.Errorf("get configurator failed when get app flow weight, resourceKey: %s, err: %s", @@ -459,7 +459,7 @@ func GetAppFlowWeight(ctx consolectx.Context, appName string, mesh string) (*mod } func isFlowWeightConfig(conf *meshproto.OverrideConfig) bool { - if conf.Side != consts.SideProvider || + if conf.Side != constants.SideProvider || conf.Parameters == nil || conf.Match == nil || conf.Match.Param == nil { @@ -480,7 +480,7 @@ func UpInsertAppFlowWeightConfig(ctx consolectx.Context, appName string, mesh st if data == nil { return bizerror.New(bizerror.AppNotFound, fmt.Sprintf("%s does not exist", appName)) } - appConfiguratorName := appName + consts.ConfiguratorRuleSuffix + appConfiguratorName := appName + constants.ConfiguratorRuleSuffix res, err := GetConfigurator(ctx, appConfiguratorName, mesh) if err != nil { logger.Errorf("get configurator failed when update app flow weight, resourceKey: %s, err: %s", @@ -520,8 +520,8 @@ func insertConfiguratorWithFlowWeight( res := meshresource.NewDynamicConfigResourceWithAttributes(appConfiguratorName, mesh) res.Spec = &meshproto.DynamicConfig{ Key: appName, - Scope: consts.ScopeApplication, - ConfigVersion: consts.ConfiguratorVersionV3, + Scope: constants.ScopeApplication, + ConfigVersion: constants.ConfiguratorVersionV3, Enabled: true, } flowWeightConfigs := slice.Map(flowWeightSets, func(index int, set model.FlowWeightSet) *meshproto.OverrideConfig { @@ -546,7 +546,7 @@ func fromFlowWeightSet(set model.FlowWeightSet) *meshproto.OverrideConfig { }) } return &meshproto.OverrideConfig{ - Side: consts.SideProvider, + Side: constants.SideProvider, Parameters: map[string]string{`weight`: strconv.Itoa(int(set.Weight))}, Match: &meshproto.ConditionMatch{ Param: paramMatch, @@ -556,7 +556,7 @@ func fromFlowWeightSet(set model.FlowWeightSet) *meshproto.OverrideConfig { } func GetGrayConfig(ctx consolectx.Context, appName string, mesh string) (*model.AppGrayConfigResp, error) { resp := &model.AppGrayConfigResp{} - serviceTagRuleName := appName + consts.TagRuleSuffix + serviceTagRuleName := appName + constants.TagRuleSuffix res, err := GetTagRule(ctx, serviceTagRuleName, mesh) if err != nil { logger.Errorf("get tag rule failed when get gray config, resourceKey: %s, err: %s", @@ -595,7 +595,7 @@ func isGrayTag(tag *meshproto.Tag) bool { } func UpInsertAppGrayConfig(ctx consolectx.Context, appName string, mesh string, graySets []model.GraySet) error { - serviceTagRuleName := appName + consts.TagRuleSuffix + serviceTagRuleName := appName + constants.TagRuleSuffix res, err := GetTagRule(ctx, serviceTagRuleName, mesh) if err != nil { logger.Errorf("get tag rule failed when update app gray config, resourceKey: %s, err: %s", @@ -622,7 +622,7 @@ func insertTagRuleWithGrayConfig( res.Spec = &meshproto.TagRoute{ Enabled: true, Key: appName, - ConfigVersion: consts.ConfiguratorVersionV3, + ConfigVersion: constants.ConfiguratorVersionV3, Force: false, } tags := slice.Map(graySets, func(index int, set model.GraySet) *meshproto.Tag { diff --git a/pkg/core/bootstrap/init.go b/pkg/core/bootstrap/init.go index 8b2835401..8236bdccc 100644 --- a/pkg/core/bootstrap/init.go +++ b/pkg/core/bootstrap/init.go @@ -28,6 +28,7 @@ import ( _ "github.com/apache/dubbo-admin/pkg/discovery/mock" _ "github.com/apache/dubbo-admin/pkg/discovery/nacos2" _ "github.com/apache/dubbo-admin/pkg/engine/kubernetes" + _ "github.com/apache/dubbo-admin/pkg/engine/mock" _ "github.com/apache/dubbo-admin/pkg/store/memory" _ "github.com/apache/dubbo-admin/pkg/store/mysql" _ "github.com/apache/dubbo-admin/pkg/store/postgres" diff --git a/pkg/core/consts/const.go b/pkg/core/consts/const.go deleted file mode 100644 index 0bacadee1..000000000 --- a/pkg/core/consts/const.go +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package consts - -import ( - set "github.com/dubbogo/gost/container/set" -) - -const ( - DubboPropertyKey = "dubbo.properties" - RegistryAddressKey = "dubbo.registry.address" - MetadataReportAddressKey = "dubbo.metadata-report.address" -) - -const ( - AnyValue = "*" - AnyHostValue = "0.0.0.0" - InterfaceKey = "interface" - GroupKey = "group" - VersionKey = "version" - ClassifierKey = "classifier" - CategoryKey = "category" - ProvidersCategory = "providers" - ConsumersCategory = "consumers" - RoutersCategory = "routers" - ConfiguratorsCategory = "configurators" - ConfiguratorRuleSuffix = ".configurators" - EnabledKey = "enabled" - CheckKey = "check" - AdminProtocol = "admin" - Side = "side" - ConsumerSide = "consumer" - ProviderSide = "provider" - ConsumerProtocol = "consumer" - EmptyProtocol = "empty" - OverrideProtocol = "override" - DefaultGroup = "dubbo" - ApplicationKey = "application" - DynamicKey = "dynamic" - SerializationKey = "serialization" - TimeoutKey = "timeout" - DefaultTimeout = 1000 - WeightKey = "weight" - BalancingKey = "balancing" - DefaultWeight = 100 - OwnerKey = "owner" - Application = "application" - Service = "service" - Colon = ":" - InterrogationPoint = "?" - IP = "ip" - PlusSigns = "+" - PunctuationPoint = "." - ConditionRoute = "condition_route" - TagRoute = "tag_route" - AffinityRoute = "affinity_route" - ConditionRuleSuffix = ".condition-router" - TagRuleSuffix = ".tag-router" - AffinityRuleSuffix = ".affinity-router" - ConfigFileEnvKey = "conf" // config file path - RegistryAll = "ALL" - RegistryInterface = "INTERFACE" - RegistryInstance = "INSTANCE" - RegistryType = "TYPE" - NamespaceKey = "namespace" -) - -var Configs = set.NewSet(WeightKey, BalancingKey) - -const ( - ConfiguratorVersionV3 = `v3.0` - ConfiguratorVersionV3x1 = `v3.1` - ConfigVersionKey = `configVersion` - ScopeApplication = `application` - ScopeService = `service` - SideProvider = `provider` - SideConsumer = `consumer` -) - -const ( - StatefulSet = "StatefulSet" - Deployment = "Deployment" -) - -const ( - NotEqual = "!=" - Equal = "=" -) - -const ( - TimeFormatStr = "2006-01-02 15:04:05" -) diff --git a/pkg/core/controller/informer.go b/pkg/core/controller/informer.go index e2ab13937..8214e2d3c 100644 --- a/pkg/core/controller/informer.go +++ b/pkg/core/controller/informer.go @@ -20,14 +20,17 @@ package controller import ( "errors" "fmt" + "reflect" "sync" "time" + "github.com/go-logr/zapr" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/cache" "k8s.io/klog/v2" + "github.com/apache/dubbo-admin/pkg/common/bizerror" "github.com/apache/dubbo-admin/pkg/core/events" "github.com/apache/dubbo-admin/pkg/core/logger" "github.com/apache/dubbo-admin/pkg/core/resource/model" @@ -100,13 +103,21 @@ type informer struct { watchErrorHandler cache.WatchErrorHandler // transform is an optional function that is called on each object before it is pushed into the queue. transform cache.TransformFunc + // keyFunc see cache.KeyFunc + keyFunc cache.KeyFunc } -func NewInformerWithOptions(lw cache.ListerWatcher, emitter events.Emitter, store store.ResourceStore, options Options) Informer { +func NewInformerWithOptions( + lw cache.ListerWatcher, + emitter events.Emitter, + store store.ResourceStore, + keyFunc cache.KeyFunc, + options Options) Informer { return &informer{ indexer: store, listerWatcher: lw, emitter: emitter, + keyFunc: keyFunc, resyncCheckPeriod: options.ResyncPeriod, } } @@ -162,11 +173,13 @@ func (s *informer) Run(stopCh <-chan struct{}) { func() { s.startedLock.Lock() defer s.startedLock.Unlock() - + zapLogr := zapr.NewLogger(logger.Logger()) fifo := cache.NewDeltaFIFOWithOptions(cache.DeltaFIFOOptions{ KnownObjects: s.indexer, EmitDeltaTypeReplaced: true, Transformer: s.transform, + Logger: &zapLogr, + KeyFunction: s.keyFunc, }) // We turn off the resync mechanism because we don't want to re-list all objects. @@ -209,27 +222,36 @@ func (s *informer) HandleDeltas(obj interface{}, _ bool) error { } // from oldest to newest for _, d := range deltas { - obj := d.Object - resource, ok := obj.(model.Resource) + var resource model.Resource + var object interface{} + if o, ok := d.Object.(cache.DeletedFinalStateUnknown); ok { + object = o.Obj + } else { + object = d.Object + } + resource, ok := object.(model.Resource) if !ok { logger.Errorf("object from ListWatcher is not conformed to Resource, obj: %v", obj) - return errors.New("object from ListWatcher is not conformed to Resource") + return bizerror.NewAssertionError("Resource", reflect.TypeOf(obj).Name()) } switch d.Type { case cache.Sync, cache.Replaced, cache.Added, cache.Updated: if old, exists, err := s.indexer.Get(resource); err == nil && exists { if err := s.indexer.Update(resource); err != nil { + logger.Errorf("failed to update resource in informer, cause: %v, resource: %s,", err, resource.String()) return err } s.EmitEvent(d.Type, old.(model.Resource), resource) } else { - if err := s.indexer.Add(obj); err != nil { + if err := s.indexer.Add(resource); err != nil { + logger.Errorf("failed to add resource to informer, cause %v, resource: %s,", err, resource.String()) return err } s.EmitEvent(d.Type, nil, resource) } case cache.Deleted: - if err := s.indexer.Delete(obj); err != nil { + if err := s.indexer.Delete(resource); err != nil { + logger.Errorf("failed to delete resource from informer, cause %v, resource: %s,", err, resource.String()) return err } s.EmitEvent(d.Type, resource, nil) diff --git a/pkg/core/discovery/component.go b/pkg/core/discovery/component.go index a754ce219..6efd7ff5a 100644 --- a/pkg/core/discovery/component.go +++ b/pkg/core/discovery/component.go @@ -22,8 +22,11 @@ import ( "math" "reflect" + "github.com/duke-git/lancet/v2/slice" + "github.com/apache/dubbo-admin/pkg/common/bizerror" "github.com/apache/dubbo-admin/pkg/config/discovery" + "github.com/apache/dubbo-admin/pkg/config/engine" "github.com/apache/dubbo-admin/pkg/core/controller" "github.com/apache/dubbo-admin/pkg/core/discovery/subscriber" "github.com/apache/dubbo-admin/pkg/core/events" @@ -97,7 +100,7 @@ func (d *discoveryComponent) Init(ctx runtime.BuilderContext) error { } d.informers[cfg.Name] = informers } - err = d.initSubscribes(storeRouter, eventBus) + err = d.initSubscribes(storeRouter, eventBus, ctx.Config().Engine) if err != nil { return err } @@ -137,7 +140,7 @@ func (d *discoveryComponent) Delete(resource coremodel.Resource) error { panic("implement me") } -func (d *discoveryComponent) initInformers(cfg *discovery.Config, storeRouter store.Router, emitter events.Emitter) (Informers, error) { +func (d *discoveryComponent) initInformers(cfg *discovery.Config, storeRouter store.Router, eventBus events.EventBus) (Informers, error) { factory, err := ListWatcherFactoryRegistry().GetListWatcherFactory(cfg.Type) if err != nil { return nil, err @@ -152,18 +155,48 @@ func (d *discoveryComponent) initInformers(cfg *discovery.Config, storeRouter st if err != nil { return nil, fmt.Errorf("cannot find store for resource kind %s", lw.ResourceKind()) } - informer := controller.NewInformerWithOptions(lw, emitter, resourceStore, controller.Options{ResyncPeriod: 0}) + informer := controller.NewInformerWithOptions(lw, eventBus, resourceStore, keyFunc, controller.Options{ResyncPeriod: 0}) informers[i] = informer } return informers, nil } +func keyFunc(obj interface{}) (string, error) { + if r, ok := obj.(coremodel.Resource); ok { + return r.ResourceKey(), nil + } + return "", bizerror.NewAssertionError("Resource", reflect.TypeOf(obj).Name()) +} -func (d *discoveryComponent) initSubscribes(storeRouter store.Router, emitter events.Emitter) error { - rs, err := storeRouter.ResourceKindRoute(meshresource.InstanceKind) +func (d *discoveryComponent) initSubscribes(storeRouter store.Router, emitter events.Emitter, engineConfig *engine.Config) error { + instanceStore, err := storeRouter.ResourceKindRoute(meshresource.InstanceKind) + if err != nil { + return bizerror.Wrap(err, bizerror.StoreError, + fmt.Sprintf("can not find store for resource kind %s", meshresource.InstanceKind)) + } + rtInstanceStore, err := storeRouter.ResourceKindRoute(meshresource.RuntimeInstanceKind) if err != nil { - return fmt.Errorf("can not find store for resource kind %s, %w", meshresource.InstanceKind, err) + return bizerror.Wrap(err, bizerror.StoreError, + fmt.Sprintf("can not find store for resource kind %s", meshresource.RuntimeInstanceKind)) + } + rpcInstanceSub := subscriber.NewRPCInstanceEventSubscriber(instanceStore, rtInstanceStore, emitter, engineConfig) + + appStore, err := storeRouter.ResourceKindRoute(meshresource.ApplicationKind) + if err != nil { + return bizerror.Wrap(err, bizerror.StoreError, + fmt.Sprintf("can not find store for resource kind %s", meshresource.ApplicationKind)) + } + serviceConsumerMetadataSub := subscriber.NewServiceConsumerMetadataEventSubscriber(appStore, emitter) + serviceProviderMetadataSub := subscriber.NewServiceProviderMetadataEventSubscriber(appStore, emitter) + + d.subscribers = append(d.subscribers, rpcInstanceSub, serviceConsumerMetadataSub, serviceProviderMetadataSub) + + // if there is a nacos discovery, a NacosServiceEventSubscriber is needed + _, hasNacosDiscovery := slice.FindBy(d.configs, func(index int, item *discovery.Config) bool { + return item.Type == discovery.Nacos2 + }) + if hasNacosDiscovery { + nacosServiceSub := subscriber.NewNacosServiceEventSubscriber(emitter, storeRouter) + d.subscribers = append(d.subscribers, nacosServiceSub) } - rpcInstanceSub := subscriber.NewRPCInstanceEventSubscriber(rs, emitter) - d.subscribers = append(d.subscribers, rpcInstanceSub) return nil } diff --git a/pkg/core/discovery/subscriber/nacos_service.go b/pkg/core/discovery/subscriber/nacos_service.go new file mode 100644 index 000000000..ca25e6829 --- /dev/null +++ b/pkg/core/discovery/subscriber/nacos_service.go @@ -0,0 +1,402 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package subscriber + +import ( + "encoding/json" + "fmt" + "reflect" + "regexp" + "strconv" + "strings" + "time" + + "github.com/duke-git/lancet/v2/convertor" + set "github.com/duke-git/lancet/v2/datastructure/set" + "github.com/duke-git/lancet/v2/maputil" + "github.com/duke-git/lancet/v2/slice" + "k8s.io/client-go/tools/cache" + + meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" + "github.com/apache/dubbo-admin/pkg/core/events" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" + "github.com/apache/dubbo-admin/pkg/core/store" + "github.com/apache/dubbo-admin/pkg/core/store/index" +) + +type NacosServiceEventSubscriber struct { + emitter events.Emitter + storeRouter store.Router +} + +func NewNacosServiceEventSubscriber(eventEmitter events.Emitter, storeRouter store.Router) *NacosServiceEventSubscriber { + return &NacosServiceEventSubscriber{ + emitter: eventEmitter, + storeRouter: storeRouter, + } +} + +func (n *NacosServiceEventSubscriber) ResourceKind() coremodel.ResourceKind { + return meshresource.NacosServiceKind +} + +func (n *NacosServiceEventSubscriber) Name() string { + return "Nacos2Discovery-" + n.ResourceKind().ToString() +} + +func (n *NacosServiceEventSubscriber) ProcessEvent(event events.Event) error { + newObj, ok := event.NewObj().(*meshresource.NacosServiceResource) + if !ok && event.NewObj() != nil { + return bizerror.NewAssertionError(reflect.TypeOf(newObj), event.NewObj()) + } + oldObj, ok := event.OldObj().(*meshresource.NacosServiceResource) + if !ok && event.OldObj() != nil { + return bizerror.NewAssertionError(reflect.TypeOf(oldObj), event.OldObj()) + } + var processErr error + switch event.Type() { + case cache.Added, cache.Updated, cache.Replaced, cache.Sync: + if newObj == nil { + errStr := "process nacos service upsert event, but new obj is nil, skipped processing" + logger.Errorf(errStr) + return bizerror.New(bizerror.EventError, errStr) + } + processErr = n.processUpsert(newObj) + case cache.Deleted: + if oldObj == nil { + errStr := "process nacos service delete event, but old obj is nil, skipped processing" + logger.Errorf(errStr) + return bizerror.New(bizerror.EventError, errStr) + } + processErr = n.processDelete(oldObj) + } + if processErr != nil { + logger.Errorf("process nacos service event failed, cause: %s, event: %s", processErr.Error(), event.String()) + return processErr + } + logger.Infof("process nacos service event successfully, event: %s", event.String()) + return nil +} + +func (n *NacosServiceEventSubscriber) processUpsert(serviceRes *meshresource.NacosServiceResource) error { + providerRe := regexp.MustCompile(`^providers:[\w.]+(?::[\w.]*:|::[\w.]*)?$`) + consumerRe := regexp.MustCompile(`^consumers:[\w.]+(?::[\w.]*:|::[\w.]*)?$`) + if providerRe.MatchString(serviceRes.Name) { + logger.Infof("interface-level service ignored, service name: %s", serviceRes.Name) + return nil + } + if consumerRe.MatchString(serviceRes.Name) { + return n.processConsumerMetadataUpsert(serviceRes) + } + return n.processRPCInstanceUpsert(serviceRes) + +} + +func (n *NacosServiceEventSubscriber) processConsumerMetadataUpsert(serviceRes *meshresource.NacosServiceResource) error { + serviceName, err := parseServiceName(serviceRes.Name) + if err != nil { + return bizerror.Wrap(err, bizerror.UnknownError, "parse service name error, raw nacos service is"+serviceRes.String()) + } + convertFunc := func(i int, instance *meshproto.NacosInstance) maputil.Entry[string, *meshresource.ServiceConsumerMetadataResource] { + metadataJsonStr, err := convertor.ToJson(instance.Metadata) + if err != nil { + logger.Errorf("skipping convert service consumer %s:%d of %s to ServiceConsumerMetadata "+ + "because it cannot convert to valid json string", instance.Ip, instance.Port, serviceRes.Name) + return maputil.Entry[string, *meshresource.ServiceConsumerMetadataResource]{} + } + consumerAppName, exists := instance.Metadata[constants.Application] + if !exists { + logger.Errorf("service consumer %s:%d of %s is invalid because no application name found, raw metadata: %s", + instance.Ip, instance.Port, serviceRes.Name, metadataJsonStr) + return maputil.Entry[string, *meshresource.ServiceConsumerMetadataResource]{} + } + serviceName, exists := instance.Metadata[constants.InterfaceKey] + if !exists { + logger.Errorf("service consumer %s:%d of %s is invalid because no service name found, raw metadata: %s", + instance.Ip, instance.Port, serviceRes.Name, metadataJsonStr) + return maputil.Entry[string, *meshresource.ServiceConsumerMetadataResource]{} + } + version := instance.Metadata[constants.VersionKey] + group := instance.Metadata[constants.GroupKey] + resKey := consumerAppName + ":" + serviceRes.Name + res := meshresource.NewServiceConsumerMetadataResourceWithAttributes(resKey, serviceRes.Mesh) + res.Spec = &meshproto.ServiceConsumerMetadata{ + ServiceName: serviceName, + ConsumerAppName: consumerAppName, + Version: version, + Group: group, + Metadata: instance.Metadata, + } + return maputil.Entry[string, *meshresource.ServiceConsumerMetadataResource]{ + Key: res.ResourceKey(), + Value: res, + } + } + newConsumers := maputil.FromEntries(slice.Map(serviceRes.Spec.Instances, convertFunc)) + st, err := n.storeRouter.ResourceKindRoute(meshresource.ServiceConsumerMetadataKind) + if err != nil { + logger.Errorf("process service consumer metadata upsert event, but cannot route to service consumer metadata resource, cause: %v", err) + return err + } + resources, err := st.ListByIndexes(map[string]string{ + index.ByServiceConsumerServiceName: serviceName, + }) + if err != nil { + logger.Errorf("process service consumer metadata upsert event, but cannot list service consumer metadata resource of %s, cause: %v", serviceRes.Name, err) + return err + } + oldConsumers := make(map[string]*meshresource.ServiceConsumerMetadataResource) + for _, res := range resources { + oldConsumer, ok := res.(*meshresource.ServiceConsumerMetadataResource) + if !ok { + return bizerror.NewAssertionError(meshresource.ServiceConsumerMetadataKind, reflect.TypeOf(res).Name()) + } + oldConsumers[oldConsumer.ResourceKey()] = oldConsumer + } + // Find offline consumers and delete them + offlineConsumers := maputil.Minus(oldConsumers, newConsumers) + slice.ForEach(maputil.Values(offlineConsumers), func(_ int, item *meshresource.ServiceConsumerMetadataResource) { + err := st.Delete(item) + if err != nil { + logger.Errorf("delete service consumer metadata %s failed, cause: %v", item.ResourceKey(), err) + return + } + n.emitter.Send(events.NewResourceChangedEvent(cache.Deleted, item, nil)) + }) + // Find consumers need to add and add them + addConsumers := maputil.Minus(newConsumers, oldConsumers) + slice.ForEach(maputil.Values(addConsumers), func(_ int, item *meshresource.ServiceConsumerMetadataResource) { + err := st.Add(item) + if err != nil { + logger.Errorf("add service consumer metadata %s failed, cause: %v", item.ResourceKey(), err) + return + } + n.emitter.Send(events.NewResourceChangedEvent(cache.Added, nil, item)) + }) + // Find consumers need to update and update them + updateConsumers := maputil.Intersect(newConsumers, oldConsumers) + slice.ForEach(maputil.Values(updateConsumers), func(_ int, item *meshresource.ServiceConsumerMetadataResource) { + err := st.Update(item) + if err != nil { + logger.Errorf("update service consumer metadata %s failed, cause: %v", item.ResourceKey(), err) + return + } + n.emitter.Send(events.NewResourceChangedEvent(cache.Updated, item, item)) + }) + + return nil +} + +func parseServiceName(s string) (string, error) { + const prefix = "consumers:" + if !strings.HasPrefix(s, prefix) { + return "", fmt.Errorf("invalid prefix") + } + + parts := strings.SplitN(s[len(prefix):], ":", 3) + + if len(parts) < 1 { + return "", fmt.Errorf("invalid format") + } + + return parts[0], nil +} + +func (n *NacosServiceEventSubscriber) processRPCInstanceUpsert(serviceRes *meshresource.NacosServiceResource) error { + convertFunc := func(i int, instance *meshproto.NacosInstance) maputil.Entry[string, *meshresource.RPCInstanceResource] { + resName := meshresource.BuildInstanceResName(serviceRes.Name, instance.Ip, instance.Port) + res := meshresource.NewRPCInstanceResourceWithAttributes(resName, serviceRes.Mesh) + var registerTime string + timestamp, err := strconv.ParseInt(instance.Metadata[constants.TimestampKey], 10, 64) + if err != nil { + registerTime = "" + } else { + registerTime = time.UnixMilli(timestamp).Format("2006-01-02 15:04:05") + } + revision := instance.Metadata[constants.MetadataRevisionKey] + metadataStorageType := instance.Metadata[constants.MetadataStorageTypeKey] + urlParams, exists := instance.Metadata[constants.URLParamsKey] + releaseVersion := "" + protocol := "" + serialization := "" + preferSerialization := "" + if exists { + paramsMap := make(map[string]string) + err := json.Unmarshal([]byte(urlParams), ¶msMap) + if err != nil { + logger.Warnf("parse url params failed, raw url params string: %s, cause: %v", urlParams, err) + } + releaseVersion = paramsMap[constants.ReleaseKey] + protocol = paramsMap[constants.DubboVersionKey] + serialization = paramsMap[constants.SerializationKey] + preferSerialization = paramsMap[constants.SerializationKey] + + } + var endpoints []*meshproto.Endpoint + err = json.Unmarshal([]byte(instance.Metadata[constants.EndpointsKey]), &endpoints) + if err != nil { + logger.Warnf("parse endpoints failed, raw endpoints string: %s, cause: %v", instance.Metadata[constants.EndpointsKey], err) + } + res.Spec = &meshproto.RPCInstance{ + Name: resName, + AppName: serviceRes.Name, + Ip: instance.Ip, + Port: instance.Port, + RegisterTime: registerTime, + UnregisterTime: "", + Revision: revision, + MetadataStorageType: metadataStorageType, + ReleaseVersion: releaseVersion, + Protocol: protocol, + Serialization: serialization, + PreferSerialization: preferSerialization, + Tags: getRPCInstanceTags(instance.Metadata), + Endpoints: endpoints, + Metadata: instance.Metadata, + } + return maputil.Entry[string, *meshresource.RPCInstanceResource]{ + Key: res.ResourceKey(), + Value: res, + } + } + newInstances := maputil.FromEntries(slice.Map(serviceRes.Spec.Instances, convertFunc)) + st, err := n.storeRouter.ResourceKindRoute(meshresource.RPCInstanceKind) + if err != nil { + logger.Errorf("process rpc instance upsert event, but cannot route to rpc instance resource, cause: %v", err) + return err + } + resources, err := st.ListByIndexes(map[string]string{ + index.ByRPCInstanceAppName: serviceRes.Name, + }) + if err != nil { + logger.Errorf("process rpc instance upsert event, but cannot list rpc instance resource of %s, cause: %v", serviceRes.Name, err) + return err + } + oldInstances := make(map[string]*meshresource.RPCInstanceResource) + for _, res := range resources { + oldInstance, ok := res.(*meshresource.RPCInstanceResource) + if !ok { + return bizerror.NewAssertionError(meshresource.RPCInstanceKind, reflect.TypeOf(res).Name()) + } + oldInstances[oldInstance.ResourceKey()] = oldInstance + } + // find offline instances and delete them + offlineInstances := maputil.Minus(oldInstances, newInstances) + slice.ForEach(maputil.Values(offlineInstances), func(_ int, item *meshresource.RPCInstanceResource) { + err := st.Delete(item) + if err != nil { + logger.Errorf("delete rpc instance %s failed, cause: %v", item.ResourceKey(), err) + return + } + n.emitter.Send(events.NewResourceChangedEvent(cache.Deleted, item, nil)) + }) + // find instances need to add and add them + addInstances := maputil.Minus(newInstances, oldInstances) + slice.ForEach(maputil.Values(addInstances), func(_ int, item *meshresource.RPCInstanceResource) { + err := st.Add(item) + if err != nil { + logger.Errorf("add rpc instance %s failed, cause: %v", item.ResourceKey(), err) + return + } + n.emitter.Send(events.NewResourceChangedEvent(cache.Added, nil, item)) + }) + // find instances need to update and update them + updateInstances := maputil.Intersect(newInstances, oldInstances) + slice.ForEach(maputil.Values(updateInstances), func(_ int, item *meshresource.RPCInstanceResource) { + err := st.Update(item) + if err != nil { + logger.Errorf("update rpc instance %s failed, cause: %v", item.ResourceKey(), err) + return + } + n.emitter.Send(events.NewResourceChangedEvent(cache.Updated, item, item)) + }) + logger.Debugf("process rpc instance upsert event, oldInstances: %s, newInstances: %s, offlineInstances: %s, addInstances: %s, updateInstances: %s", + maputil.Keys(oldInstances), maputil.Keys(newInstances), maputil.Keys(offlineInstances), maputil.Keys(addInstances), maputil.Keys(updateInstances)) + return nil +} + +func getRPCInstanceTags(metadata map[string]string) map[string]string { + knownKeys := set.New[string](constants.URLParamsKey, constants.EndpointsKey, + constants.MetadataRevisionKey, constants.MetadataStorageTypeKey, constants.TimestampKey) + return maputil.Filter(metadata, func(key string, value string) bool { + return !knownKeys.Contain(key) + }) +} + +func (n *NacosServiceEventSubscriber) processDelete(serviceRes *meshresource.NacosServiceResource) error { + providerRe := regexp.MustCompile(`^providers:[\w.]+(?::[\w.]*:|::[\w.]*)?$`) + consumerRe := regexp.MustCompile(`^consumers:[\w.]+(?::[\w.]*:|::[\w.]*)?$`) + if providerRe.MatchString(serviceRes.Name) { + logger.Infof("interface-level service ignored, service name: %s", serviceRes.Name) + return nil + } + if consumerRe.MatchString(serviceRes.Name) { + return n.processServiceConsumerDelete(serviceRes) + } + return n.processRPCInstanceDelete(serviceRes) +} + +func (n *NacosServiceEventSubscriber) processServiceConsumerDelete(serviceRes *meshresource.NacosServiceResource) error { + st, err := n.storeRouter.ResourceKindRoute(meshresource.ServiceConsumerMetadataKind) + if err != nil { + logger.Errorf("process service consumer delete event, but cannot route to service consumer metadata resource, cause: %v", err) + return err + } + resources, err := st.ListByIndexes(map[string]string{ + index.ByServiceConsumerServiceName: serviceRes.Name, + }) + if err != nil { + logger.Errorf("process service consumer delete event, but cannot list service consumer metadata resource of %s, cause: %v", serviceRes.Name, err) + return err + } + slice.ForEach(resources, func(_ int, item coremodel.Resource) { + err := st.Delete(item) + if err != nil { + logger.Errorf("delete resource failed, resource: %s, cause: %v", item.String(), err) + } + n.emitter.Send(events.NewResourceChangedEvent(cache.Deleted, item, nil)) + }) + return nil +} + +func (n *NacosServiceEventSubscriber) processRPCInstanceDelete(serviceRes *meshresource.NacosServiceResource) error { + st, err := n.storeRouter.ResourceKindRoute(meshresource.RPCInstanceKind) + if err != nil { + logger.Errorf("process rpc instance delete event, but cannot route to rpc instance resource, cause: %v", err) + return err + } + resources, err := st.ListByIndexes(map[string]string{ + index.ByRPCInstanceAppName: serviceRes.Name, + }) + if err != nil { + logger.Errorf("process rpc instance delete event, but cannot list rpc instance resource of %s, cause: %v", serviceRes.Name, err) + return err + } + slice.ForEach(resources, func(_ int, item coremodel.Resource) { + err := st.Delete(item) + if err != nil { + logger.Errorf("delete resource failed, resource: %s, cause: %v", item.String(), err) + } + n.emitter.Send(events.NewResourceChangedEvent(cache.Deleted, item, nil)) + }) + return nil +} diff --git a/pkg/core/discovery/subscriber/rpc_instance.go b/pkg/core/discovery/subscriber/rpc_instance.go index 61a09c813..952c37add 100644 --- a/pkg/core/discovery/subscriber/rpc_instance.go +++ b/pkg/core/discovery/subscriber/rpc_instance.go @@ -25,22 +25,32 @@ import ( "github.com/apache/dubbo-admin/pkg/common/bizerror" "github.com/apache/dubbo-admin/pkg/common/constants" + enginecfg "github.com/apache/dubbo-admin/pkg/config/engine" "github.com/apache/dubbo-admin/pkg/core/events" "github.com/apache/dubbo-admin/pkg/core/logger" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" "github.com/apache/dubbo-admin/pkg/core/store" + "github.com/apache/dubbo-admin/pkg/core/store/index" ) type RPCInstanceEventSubscriber struct { - instanceStore store.ResourceStore - eventEmitter events.Emitter + instanceStore store.ResourceStore + rtInstanceStore store.ResourceStore + eventEmitter events.Emitter + engineCfg *enginecfg.Config } -func NewRPCInstanceEventSubscriber(instanceStore store.ResourceStore, emitter events.Emitter) *RPCInstanceEventSubscriber { +func NewRPCInstanceEventSubscriber( + instanceStore store.ResourceStore, + rtInstanceStore store.ResourceStore, + emitter events.Emitter, + engineCfg *enginecfg.Config) *RPCInstanceEventSubscriber { return &RPCInstanceEventSubscriber{ - instanceStore: instanceStore, - eventEmitter: emitter, + instanceStore: instanceStore, + rtInstanceStore: rtInstanceStore, + eventEmitter: emitter, + engineCfg: engineCfg, } } @@ -55,11 +65,11 @@ func (s *RPCInstanceEventSubscriber) ResourceKind() coremodel.ResourceKind { func (s *RPCInstanceEventSubscriber) ProcessEvent(event events.Event) error { newObj, ok := event.NewObj().(*meshresource.RPCInstanceResource) if !ok && event.NewObj() != nil { - return bizerror.NewAssertionError(reflect.TypeOf(newObj), event.NewObj()) + return bizerror.NewAssertionError(meshresource.RPCInstanceKind, event.NewObj()) } oldObj, ok := event.OldObj().(*meshresource.RPCInstanceResource) if !ok && event.OldObj() != nil { - return bizerror.NewAssertionError(reflect.TypeOf(oldObj), event.OldObj()) + return bizerror.NewAssertionError(meshresource.RPCInstanceKind, event.OldObj()) } var processErr error switch event.Type() { @@ -79,7 +89,7 @@ func (s *RPCInstanceEventSubscriber) ProcessEvent(event events.Event) error { processErr = s.processDelete(oldObj) } if processErr != nil { - logger.Errorf("process rpc instance event cause: %s, event: %s", processErr.Error(), event.String()) + logger.Errorf("process rpc instance event failed, cause: %s, event: %s", processErr.Error(), event.String()) return processErr } logger.Infof("process rpc instance event successfully, event: %s", event.String()) @@ -99,15 +109,17 @@ func (s *RPCInstanceEventSubscriber) processUpsert(rpcInstanceRes *meshresource. // if instance resource exists, that is to say the runtime instance exists and has been watched by engine // We should merge the rpc info into it if instanceRes != nil { - s.mergeRPCInstance(instanceRes, rpcInstanceRes) + meshresource.MergeRPCInstanceIntoInstance(rpcInstanceRes, instanceRes) return s.instanceStore.Update(instanceRes) } // Otherwise we can create a new instance resource by rpc instance - instanceRes = s.fromRPCInstance(rpcInstanceRes) + instanceRes = meshresource.FromRPCInstance(rpcInstanceRes) + s.findRelatedRuntimeInstanceAndMerge(instanceRes) if err := s.instanceStore.Add(instanceRes); err != nil { logger.Errorf("add instance resource failed, instance: %s, err: %s", instanceRes.ResourceKey(), err.Error()) return err } + instanceAddEvent := events.NewResourceChangedEvent(cache.Added, nil, instanceRes) s.eventEmitter.Send(instanceAddEvent) logger.Debugf("rpc instance upsert trigger instance add event, event: %s", instanceAddEvent.String()) @@ -146,29 +158,6 @@ func (s *RPCInstanceEventSubscriber) checkAttributeEnough(rpcInstanceRes *meshre return true } -func (s *RPCInstanceEventSubscriber) mergeRPCInstance( - instanceRes *meshresource.InstanceResource, - rpcInstanceRes *meshresource.RPCInstanceResource) { - instanceRes.Spec.ReleaseVersion = rpcInstanceRes.Spec.ReleaseVersion - instanceRes.Spec.RegisterTime = rpcInstanceRes.Spec.RegisterTime - instanceRes.Spec.UnregisterTime = rpcInstanceRes.Spec.UnregisterTime - instanceRes.Spec.Protocol = rpcInstanceRes.Spec.Protocol - instanceRes.Spec.Serialization = rpcInstanceRes.Spec.Serialization - instanceRes.Spec.PreferSerialization = rpcInstanceRes.Spec.PreferSerialization - instanceRes.Spec.Tags = rpcInstanceRes.Spec.Tags -} - -func (s *RPCInstanceEventSubscriber) fromRPCInstance(rpcInstanceRes *meshresource.RPCInstanceResource) *meshresource.InstanceResource { - resName := meshresource.BuildInstanceResName(rpcInstanceRes.Spec.AppName, rpcInstanceRes.Spec.Ip, rpcInstanceRes.Spec.Port) - instanceRes := meshresource.NewInstanceResourceWithAttributes(resName, rpcInstanceRes.Mesh) - instanceRes.Spec.Name = rpcInstanceRes.Spec.Name - instanceRes.Spec.AppName = rpcInstanceRes.Spec.AppName - instanceRes.Spec.Ip = rpcInstanceRes.Spec.Ip - instanceRes.Spec.RpcPort = rpcInstanceRes.Spec.Port - s.mergeRPCInstance(instanceRes, rpcInstanceRes) - return instanceRes -} - func (s *RPCInstanceEventSubscriber) getRelatedInstanceRes( rpcInstanceRes *meshresource.RPCInstanceResource) (*meshresource.InstanceResource, error) { instanceResName := meshresource.BuildInstanceResName(rpcInstanceRes.Spec.AppName, rpcInstanceRes.Spec.Ip, rpcInstanceRes.Spec.Port) @@ -185,3 +174,35 @@ func (s *RPCInstanceEventSubscriber) getRelatedInstanceRes( } return instanceRes, nil } + +func (s *RPCInstanceEventSubscriber) findRelatedRuntimeInstanceAndMerge(instanceRes *meshresource.InstanceResource) { + switch s.engineCfg.Type { + case enginecfg.Kubernetes: + rtInstance := s.getRuntimeInstanceByIp(instanceRes.Spec.Ip) + if rtInstance == nil { + logger.Warnf("cannot find runtime instance for isntace %s, skipping merging", instanceRes.ResourceKey()) + return + } + meshresource.MergeRuntimeInstanceIntoInstance(rtInstance, instanceRes) + default: + return + } +} + +func (s *RPCInstanceEventSubscriber) getRuntimeInstanceByIp(ip string) *meshresource.RuntimeInstanceResource { + resources, err := s.rtInstanceStore.ListByIndexes(map[string]string{ + index.ByRuntimeInstanceIPIndex: ip, + }) + if err != nil { + logger.Errorf("list runtime instance by ip index failed, ip: %s, err: %s", ip, err.Error()) + return nil + } + if len(resources) == 0 { + return nil + } + runtimeInstanceRes, ok := resources[0].(*meshresource.RuntimeInstanceResource) + if !ok { + return nil + } + return runtimeInstanceRes +} diff --git a/pkg/core/discovery/subscriber/service_consumer_metadata.go b/pkg/core/discovery/subscriber/service_consumer_metadata.go new file mode 100644 index 000000000..21e70e14a --- /dev/null +++ b/pkg/core/discovery/subscriber/service_consumer_metadata.go @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package subscriber + +import ( + "reflect" + + "github.com/duke-git/lancet/v2/strutil" + "k8s.io/client-go/tools/cache" + + "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/core/events" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" + "github.com/apache/dubbo-admin/pkg/core/store" +) + +type ServiceConsumerMetadataEventSubscriber struct { + appStore store.ResourceStore + emitter events.Emitter +} + +func NewServiceConsumerMetadataEventSubscriber( + appStore store.ResourceStore, + emitter events.Emitter) *ServiceConsumerMetadataEventSubscriber { + return &ServiceConsumerMetadataEventSubscriber{ + appStore: appStore, + emitter: emitter, + } +} + +func (s *ServiceConsumerMetadataEventSubscriber) ResourceKind() coremodel.ResourceKind { + return meshresource.ServiceConsumerMetadataKind +} + +func (s *ServiceConsumerMetadataEventSubscriber) Name() string { + return "Discovery-" + s.ResourceKind().ToString() +} + +func (s *ServiceConsumerMetadataEventSubscriber) ProcessEvent(event events.Event) error { + newObj, ok := event.NewObj().(*meshresource.ServiceConsumerMetadataResource) + if !ok && event.NewObj() != nil { + return bizerror.NewAssertionError(reflect.TypeOf(newObj), event.NewObj()) + } + var processErr error + switch event.Type() { + case cache.Added, cache.Updated, cache.Replaced, cache.Sync: + if newObj == nil { + errStr := "process consumer metadata resource upsert event, but new obj is nil, skipped processing" + logger.Errorf(errStr) + return bizerror.New(bizerror.EventError, errStr) + } + processErr = s.processUpsert(newObj) + case cache.Deleted: + logger.Warnf("ignored consumer metadata resource deleted event in ServiceConsumerMetadataEventSubscriber") + } + if processErr != nil { + logger.Errorf("process consumer metadata resource event failed, cause: %s, event: %s", processErr.Error(), event.String()) + return processErr + } + logger.Infof("process consumer metadata resource event successfully, event: %s", event.String()) + return nil +} + +func (s *ServiceConsumerMetadataEventSubscriber) processUpsert(r *meshresource.ServiceConsumerMetadataResource) error { + if r.Spec == nil { + return bizerror.New(bizerror.UnknownError, "consumer metadata resource spec is nil") + } + if strutil.IsBlank(r.Spec.ConsumerAppName) { + logger.Warnf("skip processing service consumer metadata event because spec.consumerAppName is blank, res:%s", r.String()) + return nil + } + _, exists, err := s.appStore.GetByKey(coremodel.BuildResourceKey(r.Mesh, r.Spec.ConsumerAppName)) + if err != nil { + logger.Errorf("get application resource failed, appName: %s, mesh: %s, cause: %s", + r.Spec.ConsumerAppName, r.Mesh, err.Error()) + return err + } + if exists { + logger.Infof("application resource already exists, appName: %s, mesh: %s", r.Spec.ConsumerAppName, r.Mesh) + return nil + } + appRes := meshresource.NewApplicationResourceWithAttributes(r.Spec.ConsumerAppName, r.Mesh) + appRes.Spec.Name = r.Spec.ConsumerAppName + if err := s.appStore.Add(appRes); err != nil { + logger.Errorf("add application resource failed, appName: %s, mesh: %s, cause: %s", + r.Spec.ConsumerAppName, r.Mesh, err.Error()) + return err + } + s.emitter.Send(events.NewResourceChangedEvent(cache.Added, nil, appRes)) + return nil +} diff --git a/pkg/core/discovery/subscriber/service_provider_metadata.go b/pkg/core/discovery/subscriber/service_provider_metadata.go new file mode 100644 index 000000000..3c508e486 --- /dev/null +++ b/pkg/core/discovery/subscriber/service_provider_metadata.go @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package subscriber + +import ( + "reflect" + + "github.com/duke-git/lancet/v2/strutil" + "k8s.io/client-go/tools/cache" + + "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/core/events" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" + "github.com/apache/dubbo-admin/pkg/core/store" +) + +type ServiceProviderMetadataEventSubscriber struct { + appStore store.ResourceStore + emitter events.Emitter +} + +func NewServiceProviderMetadataEventSubscriber( + appStore store.ResourceStore, + emitter events.Emitter) *ServiceProviderMetadataEventSubscriber { + return &ServiceProviderMetadataEventSubscriber{ + appStore: appStore, + emitter: emitter, + } +} + +func (s *ServiceProviderMetadataEventSubscriber) ResourceKind() coremodel.ResourceKind { + return meshresource.ServiceProviderMetadataKind +} + +func (s *ServiceProviderMetadataEventSubscriber) Name() string { + return "Discovery-" + s.ResourceKind().ToString() +} + +func (s *ServiceProviderMetadataEventSubscriber) ProcessEvent(event events.Event) error { + newObj, ok := event.NewObj().(*meshresource.ServiceProviderMetadataResource) + if !ok && event.NewObj() != nil { + return bizerror.NewAssertionError(reflect.TypeOf(newObj), event.NewObj()) + } + var processErr error + switch event.Type() { + case cache.Added, cache.Updated, cache.Replaced, cache.Sync: + if newObj == nil { + errStr := "process provider metadata resource upsert event, but new obj is nil, skipped processing" + logger.Errorf(errStr) + return bizerror.New(bizerror.EventError, errStr) + } + processErr = s.processUpsert(newObj) + case cache.Deleted: + logger.Warnf("ignored provider metadata resource deleted event in ServiceProviderMetadataEventSubscriber") + } + if processErr != nil { + logger.Errorf("process provider metadata resource event failed, cause: %s, event: %s", processErr.Error(), event.String()) + return processErr + } + logger.Infof("process provider metadata resource event successfully, event: %s", event.String()) + return nil +} + +func (s *ServiceProviderMetadataEventSubscriber) processUpsert(r *meshresource.ServiceProviderMetadataResource) error { + if r.Spec == nil { + return bizerror.New(bizerror.UnknownError, "provider metadata resource spec is nil") + } + if strutil.IsBlank(r.Spec.ProviderAppName) { + logger.Warnf("skip processing service provider metadata event because spec.providerAppName is blank, res:%s", r.String()) + return nil + } + _, exists, err := s.appStore.GetByKey(coremodel.BuildResourceKey(r.Mesh, r.Spec.ProviderAppName)) + if err != nil { + logger.Errorf("get application resource failed, appName: %s, mesh: %s, cause: %s", + r.Spec.ProviderAppName, r.Mesh, err.Error()) + return err + } + if exists { + logger.Infof("application resource already exists, appName: %s, mesh: %s", r.Spec.ProviderAppName, r.Mesh) + return nil + } + appRes := meshresource.NewApplicationResourceWithAttributes(r.Spec.ProviderAppName, r.Mesh) + appRes.Spec.Name = r.Spec.ProviderAppName + if err := s.appStore.Add(appRes); err != nil { + logger.Errorf("add application resource failed, appName: %s, mesh: %s, cause: %s", + r.Spec.ProviderAppName, r.Mesh, err.Error()) + return err + } + s.emitter.Send(events.NewResourceChangedEvent(cache.Added, nil, appRes)) + return nil +} diff --git a/pkg/core/engine/component.go b/pkg/core/engine/component.go index bbf5bed80..6d366da3d 100644 --- a/pkg/core/engine/component.go +++ b/pkg/core/engine/component.go @@ -22,6 +22,8 @@ import ( "math" "reflect" + "k8s.io/client-go/tools/cache" + "github.com/apache/dubbo-admin/pkg/common/bizerror" enginecfg "github.com/apache/dubbo-admin/pkg/config/engine" "github.com/apache/dubbo-admin/pkg/core/controller" @@ -112,7 +114,7 @@ func (e *engineComponent) initInformers(cfg *enginecfg.Config, emitter events.Em if err != nil { return fmt.Errorf("can not find store for resource kind %s, %w", rk, err) } - informer := controller.NewInformerWithOptions(lw, emitter, rs, controller.Options{ResyncPeriod: 0}) + informer := controller.NewInformerWithOptions(lw, emitter, rs, cache.MetaNamespaceKeyFunc, controller.Options{ResyncPeriod: 0}) if lw.TransformFunc() != nil { err = informer.SetTransform(lw.TransformFunc()) if err != nil { diff --git a/pkg/core/engine/subscriber/runtime_instance.go b/pkg/core/engine/subscriber/runtime_instance.go index 50a065a0a..8c0528ecc 100644 --- a/pkg/core/engine/subscriber/runtime_instance.go +++ b/pkg/core/engine/subscriber/runtime_instance.go @@ -106,7 +106,7 @@ func (s *RuntimeInstanceEventSubscriber) processUpsert(rtInstanceRes *meshresour // if instance resource exists, that is to say the rpc instance exists in remote registry and has been watched by discovery. // so we should merge the runtime info into it if instanceResource != nil { - s.mergeRuntimeInstance(instanceResource, rtInstanceRes) + meshresource.MergeRuntimeInstanceIntoInstance(rtInstanceRes, instanceResource) return s.instanceStore.Update(instanceResource) } // if instance resource does not exist, that is to say the rpc instance does not exist in remote registry. @@ -116,7 +116,7 @@ func (s *RuntimeInstanceEventSubscriber) processUpsert(rtInstanceRes *meshresour return nil } // if conditions met, we should create a new instance resource by runtime instance - instanceRes := s.fromRuntimeInstance(rtInstanceRes) + instanceRes := meshresource.FromRuntimeInstance(rtInstanceRes) if err = s.instanceStore.Add(instanceRes); err != nil { logger.Errorf("add instance resource failed, instance: %s, err: %s", instanceRes.ResourceKey(), err.Error()) return err @@ -217,38 +217,10 @@ func (s *RuntimeInstanceEventSubscriber) getRelatedInstanceByIP( return instanceResList[0], nil } -func (s *RuntimeInstanceEventSubscriber) mergeRuntimeInstance( - instanceRes *meshresource.InstanceResource, - rtInstanceRes *meshresource.RuntimeInstanceResource) { - instanceRes.Labels = rtInstanceRes.Labels - instanceRes.Spec.Image = rtInstanceRes.Spec.Image - instanceRes.Spec.CreateTime = rtInstanceRes.Spec.CreateTime - instanceRes.Spec.StartTime = rtInstanceRes.Spec.StartTime - instanceRes.Spec.ReadyTime = rtInstanceRes.Spec.ReadyTime - instanceRes.Spec.DeployState = rtInstanceRes.Spec.Phase - instanceRes.Spec.WorkloadType = rtInstanceRes.Spec.WorkloadType - instanceRes.Spec.WorkloadName = rtInstanceRes.Spec.WorkloadName - instanceRes.Spec.Node = rtInstanceRes.Spec.Node - instanceRes.Spec.Probes = rtInstanceRes.Spec.Probes - instanceRes.Spec.Conditions = rtInstanceRes.Spec.Conditions -} - -func (s *RuntimeInstanceEventSubscriber) fromRuntimeInstance( - rtInstanceRes *meshresource.RuntimeInstanceResource) *meshresource.InstanceResource { - resName := meshresource.BuildInstanceResName(rtInstanceRes.Spec.AppName, rtInstanceRes.Spec.Ip, rtInstanceRes.Spec.RpcPort) - instanceRes := meshresource.NewInstanceResourceWithAttributes(resName, rtInstanceRes.Mesh) - instanceRes.Spec.Name = resName - instanceRes.Spec.AppName = rtInstanceRes.Spec.AppName - instanceRes.Spec.Ip = rtInstanceRes.Spec.Ip - instanceRes.Spec.RpcPort = rtInstanceRes.Spec.RpcPort - s.mergeRuntimeInstance(instanceRes, rtInstanceRes) - return instanceRes -} - func checkAttributesEnough(rtInstanceRes *meshresource.RuntimeInstanceResource) bool { if rtInstanceRes.Spec == nil || strutil.IsBlank(rtInstanceRes.Spec.AppName) || strutil.IsBlank(rtInstanceRes.Spec.Ip) || rtInstanceRes.Spec.RpcPort <= 0 || - strutil.IsBlank(rtInstanceRes.Spec.Mesh) || constants.DefaultMesh == rtInstanceRes.Spec.Mesh { + strutil.IsBlank(rtInstanceRes.Mesh) || constants.DefaultMesh == rtInstanceRes.Mesh { return false } return true diff --git a/pkg/core/events/component.go b/pkg/core/events/component.go index 8cd5e492a..97d075123 100644 --- a/pkg/core/events/component.go +++ b/pkg/core/events/component.go @@ -107,7 +107,7 @@ func (b *eventBus) Send(event Event) { } subs, exists := b.subscriberDir[rk] if !exists { - logger.Warnf("no subscriber for resource %s, skipped sending event%v", rk, event) + logger.Infof("no subscriber for resource %s, skipped sending event%v", rk, event) return } for _, sub := range subs { diff --git a/pkg/core/resource/apis/mesh/v1alpha1/affinityroute_types.go b/pkg/core/resource/apis/mesh/v1alpha1/affinityroute_types.go index ad810110d..b91fc2689 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/affinityroute_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/affinityroute_types.go @@ -35,7 +35,7 @@ import ( const AffinityRouteKind coremodel.ResourceKind = "AffinityRoute" func init() { - coremodel.RegisterResourceSchema(AffinityRouteKind, NewAffinityRouteResource) + coremodel.RegisterResourceSchema(AffinityRouteKind, NewAffinityRouteResource, NewAffinityRouteResourceList) } type AffinityRouteResource struct { @@ -136,7 +136,7 @@ func NewAffinityRouteResource() coremodel.Resource { type AffinityRouteResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []AffinityRouteResource `json:"items"` + Items []*AffinityRouteResource `json:"items"` } func (r *AffinityRouteResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *AffinityRouteResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]AffinityRouteResource, len(r.Items)) + out.Items = make([]*AffinityRouteResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*AffinityRouteResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*AffinityRouteResource) } return out } -func NewAffinityRouteResourceList() *AffinityRouteResourceList { +func NewAffinityRouteResourceList() coremodel.ResourceList { return &AffinityRouteResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(AffinityRouteKind), APIVersion: "v1alpha1", }, + Items: make([]*AffinityRouteResource, 0), + } +} + +func (r *AffinityRouteResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*AffinityRouteResource, len(items)) + for i := range items { + res, ok := items[i].(*AffinityRouteResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", AffinityRouteKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewAffinityRouteResourceListWithItems(items ...*AffinityRouteResource) *AffinityRouteResourceList { + return &AffinityRouteResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(AffinityRouteKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/application_types.go b/pkg/core/resource/apis/mesh/v1alpha1/application_types.go index b10a5fe84..39a633609 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/application_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/application_types.go @@ -35,7 +35,7 @@ import ( const ApplicationKind coremodel.ResourceKind = "Application" func init() { - coremodel.RegisterResourceSchema(ApplicationKind, NewApplicationResource) + coremodel.RegisterResourceSchema(ApplicationKind, NewApplicationResource, NewApplicationResourceList) } type ApplicationResource struct { @@ -136,7 +136,7 @@ func NewApplicationResource() coremodel.Resource { type ApplicationResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ApplicationResource `json:"items"` + Items []*ApplicationResource `json:"items"` } func (r *ApplicationResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *ApplicationResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]ApplicationResource, len(r.Items)) + out.Items = make([]*ApplicationResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*ApplicationResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*ApplicationResource) } return out } -func NewApplicationResourceList() *ApplicationResourceList { +func NewApplicationResourceList() coremodel.ResourceList { return &ApplicationResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(ApplicationKind), APIVersion: "v1alpha1", }, + Items: make([]*ApplicationResource, 0), + } +} + +func (r *ApplicationResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*ApplicationResource, len(items)) + for i := range items { + res, ok := items[i].(*ApplicationResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", ApplicationKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewApplicationResourceListWithItems(items ...*ApplicationResource) *ApplicationResourceList { + return &ApplicationResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ApplicationKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/conditionroute_types.go b/pkg/core/resource/apis/mesh/v1alpha1/conditionroute_types.go index ef486e813..4bc306e49 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/conditionroute_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/conditionroute_types.go @@ -35,7 +35,7 @@ import ( const ConditionRouteKind coremodel.ResourceKind = "ConditionRoute" func init() { - coremodel.RegisterResourceSchema(ConditionRouteKind, NewConditionRouteResource) + coremodel.RegisterResourceSchema(ConditionRouteKind, NewConditionRouteResource, NewConditionRouteResourceList) } type ConditionRouteResource struct { @@ -136,7 +136,7 @@ func NewConditionRouteResource() coremodel.Resource { type ConditionRouteResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ConditionRouteResource `json:"items"` + Items []*ConditionRouteResource `json:"items"` } func (r *ConditionRouteResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *ConditionRouteResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]ConditionRouteResource, len(r.Items)) + out.Items = make([]*ConditionRouteResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*ConditionRouteResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*ConditionRouteResource) } return out } -func NewConditionRouteResourceList() *ConditionRouteResourceList { +func NewConditionRouteResourceList() coremodel.ResourceList { return &ConditionRouteResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(ConditionRouteKind), APIVersion: "v1alpha1", }, + Items: make([]*ConditionRouteResource, 0), + } +} + +func (r *ConditionRouteResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*ConditionRouteResource, len(items)) + for i := range items { + res, ok := items[i].(*ConditionRouteResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", ConditionRouteKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewConditionRouteResourceListWithItems(items ...*ConditionRouteResource) *ConditionRouteResourceList { + return &ConditionRouteResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ConditionRouteKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/dynamicconfig_types.go b/pkg/core/resource/apis/mesh/v1alpha1/dynamicconfig_types.go index ebd9f5c9b..ad20aca5f 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/dynamicconfig_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/dynamicconfig_types.go @@ -35,7 +35,7 @@ import ( const DynamicConfigKind coremodel.ResourceKind = "DynamicConfig" func init() { - coremodel.RegisterResourceSchema(DynamicConfigKind, NewDynamicConfigResource) + coremodel.RegisterResourceSchema(DynamicConfigKind, NewDynamicConfigResource, NewDynamicConfigResourceList) } type DynamicConfigResource struct { @@ -136,7 +136,7 @@ func NewDynamicConfigResource() coremodel.Resource { type DynamicConfigResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []DynamicConfigResource `json:"items"` + Items []*DynamicConfigResource `json:"items"` } func (r *DynamicConfigResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *DynamicConfigResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]DynamicConfigResource, len(r.Items)) + out.Items = make([]*DynamicConfigResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*DynamicConfigResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*DynamicConfigResource) } return out } -func NewDynamicConfigResourceList() *DynamicConfigResourceList { +func NewDynamicConfigResourceList() coremodel.ResourceList { return &DynamicConfigResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(DynamicConfigKind), APIVersion: "v1alpha1", }, + Items: make([]*DynamicConfigResource, 0), + } +} + +func (r *DynamicConfigResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*DynamicConfigResource, len(items)) + for i := range items { + res, ok := items[i].(*DynamicConfigResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", DynamicConfigKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewDynamicConfigResourceListWithItems(items ...*DynamicConfigResource) *DynamicConfigResourceList { + return &DynamicConfigResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(DynamicConfigKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go b/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go index 0377c5657..7ed645298 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go @@ -24,3 +24,57 @@ import ( func BuildInstanceResName(appName string, ip string, rpcProt int64) string { return fmt.Sprintf("%s%s:%d", appName, ip, rpcProt) } + +// FromRPCInstance create an instance resource from a rpc instance resource +func FromRPCInstance(rpcInstanceRes *RPCInstanceResource) *InstanceResource { + resName := BuildInstanceResName(rpcInstanceRes.Spec.AppName, rpcInstanceRes.Spec.Ip, rpcInstanceRes.Spec.Port) + instanceRes := NewInstanceResourceWithAttributes(resName, rpcInstanceRes.Mesh) + instanceRes.Spec.Name = rpcInstanceRes.Spec.Name + instanceRes.Spec.AppName = rpcInstanceRes.Spec.AppName + instanceRes.Spec.Ip = rpcInstanceRes.Spec.Ip + instanceRes.Spec.RpcPort = rpcInstanceRes.Spec.Port + MergeRPCInstanceIntoInstance(rpcInstanceRes, instanceRes) + return instanceRes +} + +// MergeRPCInstanceIntoInstance merge rpc instance resource into instance resource +func MergeRPCInstanceIntoInstance( + rpcInstanceRes *RPCInstanceResource, + instanceRes *InstanceResource) { + instanceRes.Spec.ReleaseVersion = rpcInstanceRes.Spec.ReleaseVersion + instanceRes.Spec.RegisterTime = rpcInstanceRes.Spec.RegisterTime + instanceRes.Spec.UnregisterTime = rpcInstanceRes.Spec.UnregisterTime + instanceRes.Spec.Protocol = rpcInstanceRes.Spec.Protocol + instanceRes.Spec.Serialization = rpcInstanceRes.Spec.Serialization + instanceRes.Spec.PreferSerialization = rpcInstanceRes.Spec.PreferSerialization + instanceRes.Spec.Tags = rpcInstanceRes.Spec.Tags +} + +// FromRuntimeInstance create an instance resource from a runtime instance resource +func FromRuntimeInstance(rtInstanceRes *RuntimeInstanceResource) *InstanceResource { + resName := BuildInstanceResName(rtInstanceRes.Spec.AppName, rtInstanceRes.Spec.Ip, rtInstanceRes.Spec.RpcPort) + instanceRes := NewInstanceResourceWithAttributes(resName, rtInstanceRes.Mesh) + instanceRes.Spec.Name = resName + instanceRes.Spec.AppName = rtInstanceRes.Spec.AppName + instanceRes.Spec.Ip = rtInstanceRes.Spec.Ip + instanceRes.Spec.RpcPort = rtInstanceRes.Spec.RpcPort + MergeRuntimeInstanceIntoInstance(rtInstanceRes, instanceRes) + return instanceRes +} + +// MergeRuntimeInstanceIntoInstance merge runtime instance resource into instance resource +func MergeRuntimeInstanceIntoInstance( + rtInstanceRes *RuntimeInstanceResource, + instanceRes *InstanceResource) { + instanceRes.Labels = rtInstanceRes.Labels + instanceRes.Spec.Image = rtInstanceRes.Spec.Image + instanceRes.Spec.CreateTime = rtInstanceRes.Spec.CreateTime + instanceRes.Spec.StartTime = rtInstanceRes.Spec.StartTime + instanceRes.Spec.ReadyTime = rtInstanceRes.Spec.ReadyTime + instanceRes.Spec.DeployState = rtInstanceRes.Spec.Phase + instanceRes.Spec.WorkloadType = rtInstanceRes.Spec.WorkloadType + instanceRes.Spec.WorkloadName = rtInstanceRes.Spec.WorkloadName + instanceRes.Spec.Node = rtInstanceRes.Spec.Node + instanceRes.Spec.Probes = rtInstanceRes.Spec.Probes + instanceRes.Spec.Conditions = rtInstanceRes.Spec.Conditions +} diff --git a/pkg/core/resource/apis/mesh/v1alpha1/instance_types.go b/pkg/core/resource/apis/mesh/v1alpha1/instance_types.go index 7777e875c..7b43f8d36 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/instance_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/instance_types.go @@ -35,7 +35,7 @@ import ( const InstanceKind coremodel.ResourceKind = "Instance" func init() { - coremodel.RegisterResourceSchema(InstanceKind, NewInstanceResource) + coremodel.RegisterResourceSchema(InstanceKind, NewInstanceResource, NewInstanceResourceList) } type InstanceResource struct { @@ -136,7 +136,7 @@ func NewInstanceResource() coremodel.Resource { type InstanceResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []InstanceResource `json:"items"` + Items []*InstanceResource `json:"items"` } func (r *InstanceResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *InstanceResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]InstanceResource, len(r.Items)) + out.Items = make([]*InstanceResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*InstanceResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*InstanceResource) } return out } -func NewInstanceResourceList() *InstanceResourceList { +func NewInstanceResourceList() coremodel.ResourceList { return &InstanceResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(InstanceKind), APIVersion: "v1alpha1", }, + Items: make([]*InstanceResource, 0), + } +} + +func (r *InstanceResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*InstanceResource, len(items)) + for i := range items { + res, ok := items[i].(*InstanceResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", InstanceKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewInstanceResourceListWithItems(items ...*InstanceResource) *InstanceResourceList { + return &InstanceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(InstanceKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/nacosconfig_types.go b/pkg/core/resource/apis/mesh/v1alpha1/nacosconfig_types.go new file mode 100644 index 000000000..34959cca5 --- /dev/null +++ b/pkg/core/resource/apis/mesh/v1alpha1/nacosconfig_types.go @@ -0,0 +1,188 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by tools/resourcegen +// Run "make generate" to update this file. + +// nolint:whitespace +package v1alpha1 + +import ( + "encoding/json" + + "google.golang.org/protobuf/proto" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + + meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/core/logger" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" +) + +const NacosConfigKind coremodel.ResourceKind = "NacosConfig" + +func init() { + coremodel.RegisterResourceSchema(NacosConfigKind, NewNacosConfigResource, NewNacosConfigResourceList) +} + +type NacosConfigResource struct { + metav1.TypeMeta `json:",inline"` + + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Mesh is the name of the dubbo mesh this resource belongs to. + // It may be omitted for cluster-scoped resources. + Mesh string `json:"mesh,omitempty"` + + // Spec is the specification of the Dubbo NacosConfig resource. + Spec *meshproto.NacosConfig `json:"spec,omitempty"` + + // Status is the status of the Dubbo NacosConfig resource. + Status NacosConfigResourceStatus `json:"status,omitempty"` +} + +type NacosConfigResourceStatus struct { + // define resource-specific status here +} + +func (r *NacosConfigResource) ResourceKind() coremodel.ResourceKind { + return NacosConfigKind +} + +func (r *NacosConfigResource) MeshName() string { + return r.Mesh +} + +func (r *NacosConfigResource) ResourceKey() string { + return coremodel.BuildResourceKey(r.Mesh, r.Name) +} + +func (r *NacosConfigResource) ResourceMeta() metav1.ObjectMeta { + return r.ObjectMeta +} + +func (r *NacosConfigResource) ResourceSpec() coremodel.ResourceSpec { + return r.Spec +} + +func (r *NacosConfigResource) DeepCopyObject() k8sruntime.Object { + out := &NacosConfigResource{ + TypeMeta: r.TypeMeta, + Mesh: r.Mesh, + Status: r.Status, + } + + r.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + + if r.Spec != nil { + spec, ok := proto.Clone(r.Spec).(*meshproto.NacosConfig) + if !ok { + logger.Warnf("failed to clone spec %v, spec is not conformed to %s", r.Spec, r.ResourceKind()) + return out + } + out.Spec = spec + } + + return out +} + +func (r *NacosConfigResource) String() string { + jsonStr, err := json.Marshal(r) + if err != nil { + logger.Errorf("failed to encode NacosConfigResource: %s to json, err: %w", r.ResourceKey(), err) + return "" + } + return string(jsonStr) +} + +func NewNacosConfigResourceWithAttributes(name string, mesh string) *NacosConfigResource { + return &NacosConfigResource{ + TypeMeta: metav1.TypeMeta{ + Kind: string(NacosConfigKind), + APIVersion: "v1alpha1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Labels: map[string]string{}, + }, + Mesh: mesh, + Spec: &meshproto.NacosConfig{}, + } +} + +func NewNacosConfigResource() coremodel.Resource { + return &NacosConfigResource{ + TypeMeta: metav1.TypeMeta{ + Kind: string(NacosConfigKind), + APIVersion: "v1alpha1", + }, + Spec: &meshproto.NacosConfig{}, + } +} + +type NacosConfigResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []*NacosConfigResource `json:"items"` +} + +func (r *NacosConfigResourceList) DeepCopyObject() k8sruntime.Object { + out := &NacosConfigResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]*NacosConfigResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = r.Items[i].DeepCopyObject().(*NacosConfigResource) + } + return out +} + +func NewNacosConfigResourceList() coremodel.ResourceList { + return &NacosConfigResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(NacosConfigKind), + APIVersion: "v1alpha1", + }, + Items: make([]*NacosConfigResource, 0), + } +} + +func (r *NacosConfigResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*NacosConfigResource, len(items)) + for i := range items { + res, ok := items[i].(*NacosConfigResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", NacosConfigKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewNacosConfigResourceListWithItems(items ...*NacosConfigResource) *NacosConfigResourceList { + return &NacosConfigResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(NacosConfigKind), + APIVersion: "v1alpha1", + }, + Items: items, + } +} diff --git a/pkg/core/resource/apis/mesh/v1alpha1/nacosservice_types.go b/pkg/core/resource/apis/mesh/v1alpha1/nacosservice_types.go new file mode 100644 index 000000000..dac9fe7dc --- /dev/null +++ b/pkg/core/resource/apis/mesh/v1alpha1/nacosservice_types.go @@ -0,0 +1,188 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by tools/resourcegen +// Run "make generate" to update this file. + +// nolint:whitespace +package v1alpha1 + +import ( + "encoding/json" + + "google.golang.org/protobuf/proto" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + + meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/core/logger" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" +) + +const NacosServiceKind coremodel.ResourceKind = "NacosService" + +func init() { + coremodel.RegisterResourceSchema(NacosServiceKind, NewNacosServiceResource, NewNacosServiceResourceList) +} + +type NacosServiceResource struct { + metav1.TypeMeta `json:",inline"` + + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Mesh is the name of the dubbo mesh this resource belongs to. + // It may be omitted for cluster-scoped resources. + Mesh string `json:"mesh,omitempty"` + + // Spec is the specification of the Dubbo NacosService resource. + Spec *meshproto.NacosService `json:"spec,omitempty"` + + // Status is the status of the Dubbo NacosService resource. + Status NacosServiceResourceStatus `json:"status,omitempty"` +} + +type NacosServiceResourceStatus struct { + // define resource-specific status here +} + +func (r *NacosServiceResource) ResourceKind() coremodel.ResourceKind { + return NacosServiceKind +} + +func (r *NacosServiceResource) MeshName() string { + return r.Mesh +} + +func (r *NacosServiceResource) ResourceKey() string { + return coremodel.BuildResourceKey(r.Mesh, r.Name) +} + +func (r *NacosServiceResource) ResourceMeta() metav1.ObjectMeta { + return r.ObjectMeta +} + +func (r *NacosServiceResource) ResourceSpec() coremodel.ResourceSpec { + return r.Spec +} + +func (r *NacosServiceResource) DeepCopyObject() k8sruntime.Object { + out := &NacosServiceResource{ + TypeMeta: r.TypeMeta, + Mesh: r.Mesh, + Status: r.Status, + } + + r.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + + if r.Spec != nil { + spec, ok := proto.Clone(r.Spec).(*meshproto.NacosService) + if !ok { + logger.Warnf("failed to clone spec %v, spec is not conformed to %s", r.Spec, r.ResourceKind()) + return out + } + out.Spec = spec + } + + return out +} + +func (r *NacosServiceResource) String() string { + jsonStr, err := json.Marshal(r) + if err != nil { + logger.Errorf("failed to encode NacosServiceResource: %s to json, err: %w", r.ResourceKey(), err) + return "" + } + return string(jsonStr) +} + +func NewNacosServiceResourceWithAttributes(name string, mesh string) *NacosServiceResource { + return &NacosServiceResource{ + TypeMeta: metav1.TypeMeta{ + Kind: string(NacosServiceKind), + APIVersion: "v1alpha1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Labels: map[string]string{}, + }, + Mesh: mesh, + Spec: &meshproto.NacosService{}, + } +} + +func NewNacosServiceResource() coremodel.Resource { + return &NacosServiceResource{ + TypeMeta: metav1.TypeMeta{ + Kind: string(NacosServiceKind), + APIVersion: "v1alpha1", + }, + Spec: &meshproto.NacosService{}, + } +} + +type NacosServiceResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []*NacosServiceResource `json:"items"` +} + +func (r *NacosServiceResourceList) DeepCopyObject() k8sruntime.Object { + out := &NacosServiceResourceList{ + TypeMeta: r.TypeMeta, + } + r.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(r.Items) == 0 { + return out + } + out.Items = make([]*NacosServiceResource, len(r.Items)) + for i := range r.Items { + out.Items[i] = r.Items[i].DeepCopyObject().(*NacosServiceResource) + } + return out +} + +func NewNacosServiceResourceList() coremodel.ResourceList { + return &NacosServiceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(NacosServiceKind), + APIVersion: "v1alpha1", + }, + Items: make([]*NacosServiceResource, 0), + } +} + +func (r *NacosServiceResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*NacosServiceResource, len(items)) + for i := range items { + res, ok := items[i].(*NacosServiceResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", NacosServiceKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewNacosServiceResourceListWithItems(items ...*NacosServiceResource) *NacosServiceResourceList { + return &NacosServiceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(NacosServiceKind), + APIVersion: "v1alpha1", + }, + Items: items, + } +} diff --git a/pkg/core/resource/apis/mesh/v1alpha1/rpcinstance_types.go b/pkg/core/resource/apis/mesh/v1alpha1/rpcinstance_types.go index 6cec8dd6f..17f71d8ce 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/rpcinstance_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/rpcinstance_types.go @@ -35,7 +35,7 @@ import ( const RPCInstanceKind coremodel.ResourceKind = "RPCInstance" func init() { - coremodel.RegisterResourceSchema(RPCInstanceKind, NewRPCInstanceResource) + coremodel.RegisterResourceSchema(RPCInstanceKind, NewRPCInstanceResource, NewRPCInstanceResourceList) } type RPCInstanceResource struct { @@ -136,7 +136,7 @@ func NewRPCInstanceResource() coremodel.Resource { type RPCInstanceResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []RPCInstanceResource `json:"items"` + Items []*RPCInstanceResource `json:"items"` } func (r *RPCInstanceResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *RPCInstanceResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]RPCInstanceResource, len(r.Items)) + out.Items = make([]*RPCInstanceResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*RPCInstanceResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*RPCInstanceResource) } return out } -func NewRPCInstanceResourceList() *RPCInstanceResourceList { +func NewRPCInstanceResourceList() coremodel.ResourceList { return &RPCInstanceResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(RPCInstanceKind), APIVersion: "v1alpha1", }, + Items: make([]*RPCInstanceResource, 0), + } +} + +func (r *RPCInstanceResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*RPCInstanceResource, len(items)) + for i := range items { + res, ok := items[i].(*RPCInstanceResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", RPCInstanceKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewRPCInstanceResourceListWithItems(items ...*RPCInstanceResource) *RPCInstanceResourceList { + return &RPCInstanceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(RPCInstanceKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/rpcinstancemetadata_types.go b/pkg/core/resource/apis/mesh/v1alpha1/rpcinstancemetadata_types.go index d472e2de5..3b1f2557e 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/rpcinstancemetadata_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/rpcinstancemetadata_types.go @@ -35,7 +35,7 @@ import ( const RPCInstanceMetadataKind coremodel.ResourceKind = "RPCInstanceMetadata" func init() { - coremodel.RegisterResourceSchema(RPCInstanceMetadataKind, NewRPCInstanceMetadataResource) + coremodel.RegisterResourceSchema(RPCInstanceMetadataKind, NewRPCInstanceMetadataResource, NewRPCInstanceMetadataResourceList) } type RPCInstanceMetadataResource struct { @@ -136,7 +136,7 @@ func NewRPCInstanceMetadataResource() coremodel.Resource { type RPCInstanceMetadataResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []RPCInstanceMetadataResource `json:"items"` + Items []*RPCInstanceMetadataResource `json:"items"` } func (r *RPCInstanceMetadataResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *RPCInstanceMetadataResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]RPCInstanceMetadataResource, len(r.Items)) + out.Items = make([]*RPCInstanceMetadataResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*RPCInstanceMetadataResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*RPCInstanceMetadataResource) } return out } -func NewRPCInstanceMetadataResourceList() *RPCInstanceMetadataResourceList { +func NewRPCInstanceMetadataResourceList() coremodel.ResourceList { return &RPCInstanceMetadataResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(RPCInstanceMetadataKind), APIVersion: "v1alpha1", }, + Items: make([]*RPCInstanceMetadataResource, 0), + } +} + +func (r *RPCInstanceMetadataResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*RPCInstanceMetadataResource, len(items)) + for i := range items { + res, ok := items[i].(*RPCInstanceMetadataResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", RPCInstanceMetadataKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewRPCInstanceMetadataResourceListWithItems(items ...*RPCInstanceMetadataResource) *RPCInstanceMetadataResourceList { + return &RPCInstanceMetadataResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(RPCInstanceMetadataKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/runtimeinstance_types.go b/pkg/core/resource/apis/mesh/v1alpha1/runtimeinstance_types.go index 072425793..557c1ac2f 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/runtimeinstance_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/runtimeinstance_types.go @@ -35,7 +35,7 @@ import ( const RuntimeInstanceKind coremodel.ResourceKind = "RuntimeInstance" func init() { - coremodel.RegisterResourceSchema(RuntimeInstanceKind, NewRuntimeInstanceResource) + coremodel.RegisterResourceSchema(RuntimeInstanceKind, NewRuntimeInstanceResource, NewRuntimeInstanceResourceList) } type RuntimeInstanceResource struct { @@ -136,7 +136,7 @@ func NewRuntimeInstanceResource() coremodel.Resource { type RuntimeInstanceResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []RuntimeInstanceResource `json:"items"` + Items []*RuntimeInstanceResource `json:"items"` } func (r *RuntimeInstanceResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *RuntimeInstanceResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]RuntimeInstanceResource, len(r.Items)) + out.Items = make([]*RuntimeInstanceResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*RuntimeInstanceResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*RuntimeInstanceResource) } return out } -func NewRuntimeInstanceResourceList() *RuntimeInstanceResourceList { +func NewRuntimeInstanceResourceList() coremodel.ResourceList { return &RuntimeInstanceResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(RuntimeInstanceKind), APIVersion: "v1alpha1", }, + Items: make([]*RuntimeInstanceResource, 0), + } +} + +func (r *RuntimeInstanceResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*RuntimeInstanceResource, len(items)) + for i := range items { + res, ok := items[i].(*RuntimeInstanceResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", RuntimeInstanceKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewRuntimeInstanceResourceListWithItems(items ...*RuntimeInstanceResource) *RuntimeInstanceResourceList { + return &RuntimeInstanceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(RuntimeInstanceKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/service_helper.go b/pkg/core/resource/apis/mesh/v1alpha1/service_helper.go index 1594c23ca..3866b712b 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/service_helper.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/service_helper.go @@ -1,7 +1,7 @@ package v1alpha1 -import "github.com/apache/dubbo-admin/pkg/core/consts" +import "github.com/apache/dubbo-admin/pkg/common/constants" func BuildServiceKey(serviceName, version, group string) string { - return serviceName + consts.Colon + version + consts.Colon + group + return serviceName + constants.ColonSeparator + version + constants.ColonSeparator + group } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/service_types.go b/pkg/core/resource/apis/mesh/v1alpha1/service_types.go index 2e42bdb94..cbc6fe2f7 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/service_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/service_types.go @@ -35,7 +35,7 @@ import ( const ServiceKind coremodel.ResourceKind = "Service" func init() { - coremodel.RegisterResourceSchema(ServiceKind, NewServiceResource) + coremodel.RegisterResourceSchema(ServiceKind, NewServiceResource, NewServiceResourceList) } type ServiceResource struct { @@ -136,7 +136,7 @@ func NewServiceResource() coremodel.Resource { type ServiceResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceResource `json:"items"` + Items []*ServiceResource `json:"items"` } func (r *ServiceResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *ServiceResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]ServiceResource, len(r.Items)) + out.Items = make([]*ServiceResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*ServiceResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*ServiceResource) } return out } -func NewServiceResourceList() *ServiceResourceList { +func NewServiceResourceList() coremodel.ResourceList { return &ServiceResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(ServiceKind), APIVersion: "v1alpha1", }, + Items: make([]*ServiceResource, 0), + } +} + +func (r *ServiceResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*ServiceResource, len(items)) + for i := range items { + res, ok := items[i].(*ServiceResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", ServiceKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewServiceResourceListWithItems(items ...*ServiceResource) *ServiceResourceList { + return &ServiceResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ServiceKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/serviceconsumermetadata_types.go b/pkg/core/resource/apis/mesh/v1alpha1/serviceconsumermetadata_types.go index e63d1e0d8..913c7302d 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/serviceconsumermetadata_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/serviceconsumermetadata_types.go @@ -35,7 +35,7 @@ import ( const ServiceConsumerMetadataKind coremodel.ResourceKind = "ServiceConsumerMetadata" func init() { - coremodel.RegisterResourceSchema(ServiceConsumerMetadataKind, NewServiceConsumerMetadataResource) + coremodel.RegisterResourceSchema(ServiceConsumerMetadataKind, NewServiceConsumerMetadataResource, NewServiceConsumerMetadataResourceList) } type ServiceConsumerMetadataResource struct { @@ -136,7 +136,7 @@ func NewServiceConsumerMetadataResource() coremodel.Resource { type ServiceConsumerMetadataResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceConsumerMetadataResource `json:"items"` + Items []*ServiceConsumerMetadataResource `json:"items"` } func (r *ServiceConsumerMetadataResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *ServiceConsumerMetadataResourceList) DeepCopyObject() k8sruntime.Object if len(r.Items) == 0 { return out } - out.Items = make([]ServiceConsumerMetadataResource, len(r.Items)) + out.Items = make([]*ServiceConsumerMetadataResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*ServiceConsumerMetadataResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*ServiceConsumerMetadataResource) } return out } -func NewServiceConsumerMetadataResourceList() *ServiceConsumerMetadataResourceList { +func NewServiceConsumerMetadataResourceList() coremodel.ResourceList { return &ServiceConsumerMetadataResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(ServiceConsumerMetadataKind), APIVersion: "v1alpha1", }, + Items: make([]*ServiceConsumerMetadataResource, 0), + } +} + +func (r *ServiceConsumerMetadataResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*ServiceConsumerMetadataResource, len(items)) + for i := range items { + res, ok := items[i].(*ServiceConsumerMetadataResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", ServiceConsumerMetadataKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewServiceConsumerMetadataResourceListWithItems(items ...*ServiceConsumerMetadataResource) *ServiceConsumerMetadataResourceList { + return &ServiceConsumerMetadataResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ServiceConsumerMetadataKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermapping_types.go b/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermapping_types.go index 6392fc087..a2d9cf11e 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermapping_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermapping_types.go @@ -35,7 +35,7 @@ import ( const ServiceProviderMappingKind coremodel.ResourceKind = "ServiceProviderMapping" func init() { - coremodel.RegisterResourceSchema(ServiceProviderMappingKind, NewServiceProviderMappingResource) + coremodel.RegisterResourceSchema(ServiceProviderMappingKind, NewServiceProviderMappingResource, NewServiceProviderMappingResourceList) } type ServiceProviderMappingResource struct { @@ -136,7 +136,7 @@ func NewServiceProviderMappingResource() coremodel.Resource { type ServiceProviderMappingResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceProviderMappingResource `json:"items"` + Items []*ServiceProviderMappingResource `json:"items"` } func (r *ServiceProviderMappingResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *ServiceProviderMappingResourceList) DeepCopyObject() k8sruntime.Object if len(r.Items) == 0 { return out } - out.Items = make([]ServiceProviderMappingResource, len(r.Items)) + out.Items = make([]*ServiceProviderMappingResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*ServiceProviderMappingResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*ServiceProviderMappingResource) } return out } -func NewServiceProviderMappingResourceList() *ServiceProviderMappingResourceList { +func NewServiceProviderMappingResourceList() coremodel.ResourceList { return &ServiceProviderMappingResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(ServiceProviderMappingKind), APIVersion: "v1alpha1", }, + Items: make([]*ServiceProviderMappingResource, 0), + } +} + +func (r *ServiceProviderMappingResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*ServiceProviderMappingResource, len(items)) + for i := range items { + res, ok := items[i].(*ServiceProviderMappingResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", ServiceProviderMappingKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewServiceProviderMappingResourceListWithItems(items ...*ServiceProviderMappingResource) *ServiceProviderMappingResourceList { + return &ServiceProviderMappingResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ServiceProviderMappingKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermetadata_types.go b/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermetadata_types.go index 397b6404f..b871a7266 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermetadata_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/serviceprovidermetadata_types.go @@ -35,7 +35,7 @@ import ( const ServiceProviderMetadataKind coremodel.ResourceKind = "ServiceProviderMetadata" func init() { - coremodel.RegisterResourceSchema(ServiceProviderMetadataKind, NewServiceProviderMetadataResource) + coremodel.RegisterResourceSchema(ServiceProviderMetadataKind, NewServiceProviderMetadataResource, NewServiceProviderMetadataResourceList) } type ServiceProviderMetadataResource struct { @@ -136,7 +136,7 @@ func NewServiceProviderMetadataResource() coremodel.Resource { type ServiceProviderMetadataResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceProviderMetadataResource `json:"items"` + Items []*ServiceProviderMetadataResource `json:"items"` } func (r *ServiceProviderMetadataResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *ServiceProviderMetadataResourceList) DeepCopyObject() k8sruntime.Object if len(r.Items) == 0 { return out } - out.Items = make([]ServiceProviderMetadataResource, len(r.Items)) + out.Items = make([]*ServiceProviderMetadataResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*ServiceProviderMetadataResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*ServiceProviderMetadataResource) } return out } -func NewServiceProviderMetadataResourceList() *ServiceProviderMetadataResourceList { +func NewServiceProviderMetadataResourceList() coremodel.ResourceList { return &ServiceProviderMetadataResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(ServiceProviderMetadataKind), APIVersion: "v1alpha1", }, + Items: make([]*ServiceProviderMetadataResource, 0), + } +} + +func (r *ServiceProviderMetadataResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*ServiceProviderMetadataResource, len(items)) + for i := range items { + res, ok := items[i].(*ServiceProviderMetadataResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", ServiceProviderMetadataKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewServiceProviderMetadataResourceListWithItems(items ...*ServiceProviderMetadataResource) *ServiceProviderMetadataResourceList { + return &ServiceProviderMetadataResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(ServiceProviderMetadataKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/apis/mesh/v1alpha1/tagroute_types.go b/pkg/core/resource/apis/mesh/v1alpha1/tagroute_types.go index 45bd021b2..d9d0785bd 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/tagroute_types.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/tagroute_types.go @@ -35,7 +35,7 @@ import ( const TagRouteKind coremodel.ResourceKind = "TagRoute" func init() { - coremodel.RegisterResourceSchema(TagRouteKind, NewTagRouteResource) + coremodel.RegisterResourceSchema(TagRouteKind, NewTagRouteResource, NewTagRouteResourceList) } type TagRouteResource struct { @@ -136,7 +136,7 @@ func NewTagRouteResource() coremodel.Resource { type TagRouteResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []TagRouteResource `json:"items"` + Items []*TagRouteResource `json:"items"` } func (r *TagRouteResourceList) DeepCopyObject() k8sruntime.Object { @@ -148,18 +148,41 @@ func (r *TagRouteResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]TagRouteResource, len(r.Items)) + out.Items = make([]*TagRouteResource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*TagRouteResource) + out.Items[i] = r.Items[i].DeepCopyObject().(*TagRouteResource) } return out } -func NewTagRouteResourceList() *TagRouteResourceList { +func NewTagRouteResourceList() coremodel.ResourceList { return &TagRouteResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string(TagRouteKind), APIVersion: "v1alpha1", }, + Items: make([]*TagRouteResource, 0), + } +} + +func (r *TagRouteResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*TagRouteResource, len(items)) + for i := range items { + res, ok := items[i].(*TagRouteResource) + if !ok { + logger.Errorf("unexpected resource type, expected: %s, get %s", TagRouteKind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func NewTagRouteResourceListWithItems(items ...*TagRouteResource) *TagRouteResourceList { + return &TagRouteResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string(TagRouteKind), + APIVersion: "v1alpha1", + }, + Items: items, } } diff --git a/pkg/core/resource/model/registry.go b/pkg/core/resource/model/registry.go index bb651c29b..67883f4b3 100644 --- a/pkg/core/resource/model/registry.go +++ b/pkg/core/resource/model/registry.go @@ -29,22 +29,26 @@ func ResourceSchemaRegistry() Registry { return registry } -func RegisterResourceSchema(kind ResourceKind, newFunc NewResourceFunc) { - registry.Register(kind, newFunc) +func RegisterResourceSchema(kind ResourceKind, newFunc NewResourceFunc, newListFunc NewResourceListFunc) { + registry.Register(kind, newFunc, newListFunc) } type NewResourceFunc func() Resource +type NewResourceListFunc func() ResourceList + type Registry interface { // AllResourceKinds returns all registered resource resourceDir AllResourceKinds() []ResourceKind // NewResourceFunc returns the new resource function for a resource kind NewResourceFunc(kind ResourceKind) (NewResourceFunc, error) + // NewResourceListFunc returns the new resource list function for a resource kind + NewResourceListFunc(kind ResourceKind) (NewResourceListFunc, error) } type RegistryMutator interface { // Register registers a resource kind, if a resource kind has been registered before, it will be ignored - Register(kind ResourceKind, newFunc NewResourceFunc) + Register(kind ResourceKind, newFunc NewResourceFunc, newListFunc NewResourceListFunc) } type MutableRegistry interface { @@ -56,25 +60,42 @@ var _ MutableRegistry = &resourceSchemaRegistry{} func newRegistry() MutableRegistry { return &resourceSchemaRegistry{ - resourceDir: make(map[ResourceKind]NewResourceFunc), + resourceDir: make(map[ResourceKind]resourceSchema), } } +type resourceSchema struct { + rk ResourceKind + newFunc NewResourceFunc + newListFunc NewResourceListFunc +} + type resourceSchemaRegistry struct { - resourceDir map[ResourceKind]NewResourceFunc + resourceDir map[ResourceKind]resourceSchema } func (r *resourceSchemaRegistry) AllResourceKinds() []ResourceKind { return maputil.Keys(r.resourceDir) } -func (r *resourceSchemaRegistry) Register(kind ResourceKind, newFunc NewResourceFunc) { - r.resourceDir[kind] = newFunc +func (r *resourceSchemaRegistry) Register(kind ResourceKind, newFunc NewResourceFunc, newListFunc NewResourceListFunc) { + r.resourceDir[kind] = resourceSchema{ + rk: kind, + newFunc: newFunc, + newListFunc: newListFunc, + } } func (r *resourceSchemaRegistry) NewResourceFunc(kind ResourceKind) (NewResourceFunc, error) { - if newFunc, exists := r.resourceDir[kind]; exists { - return newFunc, nil + if rs, exists := r.resourceDir[kind]; exists { + return rs.newFunc, nil } return nil, fmt.Errorf("there is no new resource func for %s", kind) } + +func (r *resourceSchemaRegistry) NewResourceListFunc(kind ResourceKind) (NewResourceListFunc, error) { + if rs, exists := r.resourceDir[kind]; exists { + return rs.newListFunc, nil + } + return nil, fmt.Errorf("there is no new resource list func for %s", kind) +} diff --git a/pkg/core/resource/model/resource.go b/pkg/core/resource/model/resource.go index fccdc30b3..f4af8f69f 100644 --- a/pkg/core/resource/model/resource.go +++ b/pkg/core/resource/model/resource.go @@ -18,9 +18,7 @@ package model import ( - "fmt" - "reflect" - + k8smeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8sruntime "k8s.io/apimachinery/pkg/runtime" ) @@ -69,11 +67,14 @@ type Resource interface { String() string } +type ResourceList interface { + k8sruntime.Object + k8smeta.List + + SetItems(items []Resource) +} + // BuildResourceKey build a unique identifier for a resource, usually is `mesh/name` func BuildResourceKey(mesh string, name string) string { return mesh + separator + name } - -func ErrorInvalidItemType(expected, actual interface{}) error { - return fmt.Errorf("invalid argument type: expected=%q got=%q", reflect.TypeOf(expected), reflect.TypeOf(actual)) -} diff --git a/pkg/core/store/component.go b/pkg/core/store/component.go index 481de86b0..808bc473c 100644 --- a/pkg/core/store/component.go +++ b/pkg/core/store/component.go @@ -77,12 +77,6 @@ func (sc *storeComponent) Init(ctx runtime.BuilderContext) error { return err } sc.stores[kind] = store - if err = store.Init(ctx); err != nil { - return err - } - } - // 3. add indexers for each kind of store - for kind, store := range sc.stores { indexers := index.IndexersRegistry().Indexers(kind) if indexers == nil { continue @@ -90,6 +84,9 @@ func (sc *storeComponent) Init(ctx runtime.BuilderContext) error { if err := store.AddIndexers(indexers); err != nil { return err } + if err = store.Init(ctx); err != nil { + return err + } } return nil } diff --git a/pkg/core/store/index/instance.go b/pkg/core/store/index/instance.go index ff19bf38c..e7319daf3 100644 --- a/pkg/core/store/index/instance.go +++ b/pkg/core/store/index/instance.go @@ -36,7 +36,7 @@ const ( func init() { RegisterIndexers(meshresource.InstanceKind, map[string]cache.IndexFunc{ ByInstanceAppNameIndex: byInstanceAppName, - ByInstanceIpIndex: byIp, + ByInstanceIpIndex: byInstanceIp, ByInstanceNameIndex: byInstanceName, }) } @@ -52,7 +52,7 @@ func byInstanceAppName(obj interface{}) ([]string, error) { return []string{instance.Spec.AppName}, nil } -func byIp(obj interface{}) ([]string, error) { +func byInstanceIp(obj interface{}) ([]string, error) { instance, ok := obj.(*meshresource.InstanceResource) if !ok { return nil, bizerror.NewAssertionError(meshresource.InstanceKind, reflect.TypeOf(obj).Name()) diff --git a/pkg/core/store/index/rpc_instance.go b/pkg/core/store/index/rpc_instance.go new file mode 100644 index 000000000..86db39e26 --- /dev/null +++ b/pkg/core/store/index/rpc_instance.go @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package index + +import ( + "reflect" + + "github.com/duke-git/lancet/v2/strutil" + "k8s.io/client-go/tools/cache" + + "github.com/apache/dubbo-admin/pkg/common/bizerror" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" +) + +const ( + ByRPCInstanceAppName = "idx_rpc_instance_app_name" +) + +func init() { + RegisterIndexers(meshresource.RPCInstanceKind, map[string]cache.IndexFunc{ + ByRPCInstanceAppName: byRPCInstanceAppName, + }) +} + +func byRPCInstanceAppName(obj interface{}) ([]string, error) { + instance, ok := obj.(*meshresource.RPCInstanceResource) + if !ok { + return nil, bizerror.NewAssertionError(meshresource.RPCInstanceKind, reflect.TypeOf(obj).Name()) + } + if instance.Spec == nil || strutil.IsBlank(instance.Spec.AppName) { + return []string{}, nil + } + return []string{instance.Spec.AppName}, nil +} diff --git a/pkg/core/store/index/runtime_instance.go b/pkg/core/store/index/runtime_instance.go new file mode 100644 index 000000000..745e81144 --- /dev/null +++ b/pkg/core/store/index/runtime_instance.go @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package index + +import ( + "reflect" + + "github.com/duke-git/lancet/v2/strutil" + "k8s.io/client-go/tools/cache" + + "github.com/apache/dubbo-admin/pkg/common/bizerror" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" +) + +const ByRuntimeInstanceIPIndex = "idx_rt_instance_ip" + +func init() { + RegisterIndexers(meshresource.RuntimeInstanceKind, map[string]cache.IndexFunc{ + ByRuntimeInstanceIPIndex: byRuntimeInstanceIp, + }) +} + +func byRuntimeInstanceIp(obj interface{}) ([]string, error) { + rtInstance, ok := obj.(*meshresource.RuntimeInstanceResource) + if !ok { + return nil, bizerror.NewAssertionError(meshresource.RuntimeInstanceKind, reflect.TypeOf(obj).Name()) + } + if rtInstance.Spec == nil || strutil.IsBlank(rtInstance.Spec.Ip) { + return []string{}, nil + } + return []string{rtInstance.Spec.Ip}, nil +} diff --git a/pkg/core/store/index/service_consumer_metadata.go b/pkg/core/store/index/service_consumer_metadata.go index 6b5c7fa38..3498adc60 100644 --- a/pkg/core/store/index/service_consumer_metadata.go +++ b/pkg/core/store/index/service_consumer_metadata.go @@ -27,12 +27,14 @@ import ( ) const ( - ByServiceConsumerAppName = "idx_service_consumer_app_name" + ByServiceConsumerAppName = "idx_service_consumer_app_name" + ByServiceConsumerServiceName = "idx_service_consumer_service_name" ) func init() { RegisterIndexers(meshresource.ServiceConsumerMetadataKind, map[string]cache.IndexFunc{ - ByServiceConsumerAppName: byServiceConsumerAppName, + ByServiceConsumerAppName: byServiceConsumerAppName, + ByServiceConsumerServiceName: byServiceConsumerServiceName, }) } @@ -46,3 +48,14 @@ func byServiceConsumerAppName(obj interface{}) ([]string, error) { } return []string{metadata.Spec.ConsumerAppName}, nil } + +func byServiceConsumerServiceName(obj interface{}) ([]string, error) { + metadata, ok := obj.(*meshresource.ServiceConsumerMetadataResource) + if !ok { + return nil, bizerror.NewAssertionError(meshresource.ServiceConsumerMetadataKind, reflect.TypeOf(obj).Name()) + } + if metadata == nil { + return []string{}, nil + } + return []string{metadata.Spec.ServiceName}, nil +} diff --git a/pkg/discovery/nacos2/factory.go b/pkg/discovery/nacos2/factory.go index a76349207..8c0e402aa 100644 --- a/pkg/discovery/nacos2/factory.go +++ b/pkg/discovery/nacos2/factory.go @@ -1,47 +1,52 @@ package dubbogo import ( + "encoding/json" "fmt" + "strings" dubbogocom "dubbo.apache.org/dubbo-go/v3/common" dubbogoconstant "dubbo.apache.org/dubbo-go/v3/common/constant" dubbogonacos "dubbo.apache.org/dubbo-go/v3/remoting/nacos" nacosconfigclient "github.com/nacos-group/nacos-sdk-go/v2/clients/config_client" nacosnamingclient "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client" + "sigs.k8s.io/yaml" + meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" "github.com/apache/dubbo-admin/pkg/common/bizerror" + "github.com/apache/dubbo-admin/pkg/common/constants" discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" "github.com/apache/dubbo-admin/pkg/core/controller" "github.com/apache/dubbo-admin/pkg/core/discovery" + "github.com/apache/dubbo-admin/pkg/core/events" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" "github.com/apache/dubbo-admin/pkg/discovery/nacos2/listerwatcher" ) func init() { - discovery.RegisterListWatcherFactory(&Factory{}) + discovery.RegisterListWatcherFactory(&Factory{ + subscribers: make([]events.Subscriber, 0), + }) } -type Factory struct{} +type Factory struct { + subscribers []events.Subscriber +} func (f *Factory) Support(d discoverycfg.Type) bool { return d == discoverycfg.Nacos2 } -func (f *Factory) NewListWatchers(cfg *discoverycfg.Config) ([]controller.ResourceListerWatcher, error) { - nacosConfigClient, namingClient, err := f.initNacosClients(cfg) +func (f *Factory) NewListWatchers( + cfg *discoverycfg.Config) ([]controller.ResourceListerWatcher, error) { + nacosConfigClient, nacosNamingClient, err := f.initNacosClients(cfg) + listerWatchers, err := f.initListerWatchers(cfg, nacosConfigClient, nacosNamingClient) if err != nil { return nil, err } - mappingLW := listerwatcher.NewMappingListerWatcher(cfg, nacosConfigClient) - serviceProviderMetadataLW := listerwatcher.NewServiceProviderMetadataListerWatcher(cfg, nacosConfigClient) - serviceConsumerMetadataLW := listerwatcher.NewServiceConsumerMetadataListerWatcher(cfg, namingClient) - rpcInstanceLW := listerwatcher.NewRPCInstanceListerWatcher(cfg, namingClient) - - return []controller.ResourceListerWatcher{ - mappingLW, - serviceProviderMetadataLW, - serviceConsumerMetadataLW, - rpcInstanceLW, - }, nil + return listerWatchers, nil } func (f *Factory) initNacosClients( @@ -69,3 +74,133 @@ func (f *Factory) initNacosClients( } return nacosConfigClient.Client(), namingClient.Client(), nil } + +func (f *Factory) initListerWatchers( + cfg *discoverycfg.Config, + nacosConfigClient nacosconfigclient.IConfigClient, + namingClient nacosnamingclient.INamingClient) ([]controller.ResourceListerWatcher, error) { + + nacosServiceLW := listerwatcher.NewNacosServiceListerWatcher(cfg, namingClient) + dynamicConfigLW, err := listerwatcher.NewConfigListerWatcher( + meshresource.DynamicConfigKind, + cfg, + nacosConfigClient, + toDynamicResource, + true, + constants.WildcardCharacter+constants.ConfiguratorRuleSuffix, + constants.NacosConfigGroup, + ) + if err != nil { + return nil, err + } + conditionRouteLW, err := listerwatcher.NewConfigListerWatcher( + meshresource.ConditionRouteKind, + cfg, + nacosConfigClient, + toConditionRouteResource, + true, + constants.WildcardCharacter+constants.ConditionRuleSuffix, + constants.NacosConfigGroup, + ) + if err != nil { + return nil, err + } + tagRouteLW, err := listerwatcher.NewConfigListerWatcher( + meshresource.TagRouteKind, + cfg, + nacosConfigClient, + toTagRouteResource, + true, + constants.WildcardCharacter+constants.TagRuleSuffix, // "*.tag-router" + constants.NacosConfigGroup, + ) + if err != nil { + return nil, err + } + serviceProviderMetadataLW, err := listerwatcher.NewConfigListerWatcher( + meshresource.ServiceProviderMetadataKind, + cfg, + nacosConfigClient, + toServiceProviderMetadataResource, + true, + constants.ServiceProviderNacosKey, + constants.NacosConfigGroup, + ) + if err != nil { + return nil, err + } + serviceProviderMappingLW, err := listerwatcher.NewConfigListerWatcher( + meshresource.ServiceProviderMappingKind, + cfg, + nacosConfigClient, + toServiceProviderMappingResource, + false, + "", + constants.NacosMappingGroup, + ) + if err != nil { + return nil, err + } + return []controller.ResourceListerWatcher{ + nacosServiceLW, + dynamicConfigLW, + conditionRouteLW, + tagRouteLW, + serviceProviderMetadataLW, + serviceProviderMappingLW, + }, nil +} + +func toDynamicResource(mesh, dataId, content string) coremodel.Resource { + res := meshresource.NewDynamicConfigResourceWithAttributes(dataId, mesh) + err := yaml.Unmarshal([]byte(content), res.Spec) + if err != nil { + logger.Warnf("cannot unmarshal dynamic config %s in %s, cause %s, raw content:\n %s, ", dataId, mesh, err, content) + } + return res +} + +func toConditionRouteResource(mesh, dataId, content string) coremodel.Resource { + res := meshresource.NewConditionRouteResourceWithAttributes(dataId, mesh) + err := yaml.Unmarshal([]byte(content), res.Spec) + if err != nil { + logger.Warnf("cannot unmarshal condition route %s in %s, cause: %s, raw content:\n %s, ", dataId, mesh, err, content) + } + return res +} + +func toTagRouteResource(mesh, dataId, content string) coremodel.Resource { + res := meshresource.NewTagRouteResourceWithAttributes(dataId, mesh) + err := yaml.Unmarshal([]byte(content), res.Spec) + if err != nil { + logger.Warnf("cannot unmarshal tag route %s in %s, cause: %s, raw content:\n %s, ", dataId, mesh, err, content) + } + return res +} + +func toServiceProviderMetadataResource(mesh, dataId, content string) coremodel.Resource { + metadataSpec := &meshproto.ServiceProviderMetadata{} + err := json.Unmarshal([]byte(content), metadataSpec) + if err != nil { + logger.Errorf("cannot unmarshal service provider metadata %s in %s, cause: %s, raw content:\n %s,", dataId, mesh, err, content) + return nil + } + metadataSpec.ServiceName = metadataSpec.CanonicalName + metadataSpec.ProviderAppName = metadataSpec.Parameters[constants.Application] + metadataSpec.Version = metadataSpec.Parameters[constants.VersionKey] + metadataSpec.Group = metadataSpec.Parameters[constants.GroupKey] + + metadataRes := meshresource.NewServiceProviderMetadataResourceWithAttributes(dataId, mesh) + metadataRes.Spec = metadataSpec + return metadataRes +} + +func toServiceProviderMappingResource(mesh, dataId, content string) coremodel.Resource { + appNames := strings.Split(content, constants.CommaSeparator) + mappingRes := meshresource.NewServiceProviderMappingResourceWithAttributes(dataId, mesh) + mappingRes.Spec = &meshproto.ServiceProviderMapping{ + ServiceName: dataId, + AppNames: appNames, + } + return mappingRes +} diff --git a/pkg/discovery/nacos2/listerwatcher/mapping.go b/pkg/discovery/nacos2/listerwatcher/mapping.go deleted file mode 100644 index 2f60023df..000000000 --- a/pkg/discovery/nacos2/listerwatcher/mapping.go +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package listerwatcher - -import ( - "fmt" - "strings" - "time" - - "github.com/duke-git/lancet/v2/convertor" - "github.com/duke-git/lancet/v2/slice" - "github.com/go-co-op/gocron" - nacosconfigclient "github.com/nacos-group/nacos-sdk-go/v2/clients/config_client" - nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" - nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - k8sruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" - - meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" - "github.com/apache/dubbo-admin/pkg/common/bizerror" - "github.com/apache/dubbo-admin/pkg/common/constants" - discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" - "github.com/apache/dubbo-admin/pkg/core/logger" - meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" - coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" -) - -const Mapping = "mapping" - -type MappingListerWatcher struct { - cfg *discoverycfg.Config - configClient nacosconfigclient.IConfigClient - resultChan chan watch.Event - scheduler *gocron.Scheduler - stopWatch bool -} - -func NewMappingListerWatcher( - cfg *discoverycfg.Config, - configClient nacosconfigclient.IConfigClient, -) *MappingListerWatcher { - return &MappingListerWatcher{ - cfg: cfg, - configClient: configClient, - resultChan: make(chan watch.Event), - scheduler: gocron.NewScheduler(time.UTC), - stopWatch: false, - } -} - -func (lw *MappingListerWatcher) List(_ metav1.ListOptions) (k8sruntime.Object, error) { - resList := meshresource.NewServiceProviderMappingResourceList() - mappingResources, err := lw.fetchAllMappings() - if err != nil { - return nil, err - } - resList.Items = mappingResources - return resList, nil -} - -func (lw *MappingListerWatcher) Watch(_ metav1.ListOptions) (watch.Interface, error) { - _, err := lw.scheduler.Every(lw.cfg.Properties.ConfigWatchPeriod).Seconds().Do(func() { - if lw.stopWatch { - logger.Debugf("stop watching mappings") - lw.scheduler.Stop() - } - startTime := time.Now() - logger.Debugf("start fetching all mappings in nacos %s at %s", lw.cfg.Address.MetadataReport, startTime) - mappingResources, err := lw.fetchAllMappings() - if err != nil { - logger.Errorf("fetch all mappings in nacos %s failed, cause: %s", lw.cfg.Address.MetadataReport, err.Error()) - return - } - costs := time.Now().UnixMilli() - startTime.UnixMilli() - logger.Debugf("fetched all mappings in nacos %s, costs %dms", lw.cfg.Address.MetadataReport, costs) - slice.ForEach(mappingResources, func(index int, item meshresource.ServiceProviderMappingResource) { - lw.resultChan <- watch.Event{ - Type: watch.Modified, - Object: &item, - } - }) - }) - if err != nil { - return nil, bizerror.Wrap(err, bizerror.UnknownError, - fmt.Sprintf("fetch all mappings of nacos %s in a schedule occurs error", lw.cfg.Address.MetadataReport)) - } - lw.scheduler.StartAsync() - return lw, nil -} - -func (lw *MappingListerWatcher) fetchAllMappings() ([]meshresource.ServiceProviderMappingResource, error) { - listPage := func(pageNum int, pageSize int) (*nacosmodel.ConfigPage, error) { - configPage, err := lw.configClient.SearchConfig(nacosvo.SearchConfigParam{ - Search: "accurate", - Group: Mapping, - PageNo: pageNum, - PageSize: pageSize, - }) - if err != nil { - errMsg := fmt.Sprintf("cannot do page list of config, page size %d, page num %d, nacos address %s", - pageSize, pageNum, lw.cfg.Address.MetadataReport) - return nil, bizerror.Wrap(err, bizerror.NacosError, errMsg) - } - logger.Debugf("list config page, page size %d, page num %d, nacos address %s, total count %d, items %s", - pageSize, pageNum, lw.cfg.Address.MetadataReport, configPage.TotalCount, convertor.ToString(configPage.PageItems)) - return configPage, nil - } - mappingResourceList := make([]meshresource.ServiceProviderMappingResource, 0) - pageNum := 1 - pageSize := 50 - // list all mappings by page search - for { - configPage, err := listPage(pageNum, pageSize) - if err != nil { - return nil, err - } - for _, item := range configPage.PageItems { - appNames := strings.Split(item.Content, constants.CommaSeparator) - mappingResourceList = append(mappingResourceList, *lw.newMappingResource(item.DataId, appNames)) - } - if configPage.TotalCount <= pageNum*pageSize { - break - } - pageNum++ - } - return mappingResourceList, nil -} - -//func (lw *MappingListerWatcher) watchSingleMapping(res meshresource.ServiceProviderMappingResource) error { -// err := lw.configClient.Client().ListenConfig(nacosvo.ConfigParam{ -// DataId: res.Spec.ServiceName, -// Group: lw.cfg.Address.MetadataReport, -// OnChange: func(_, _, dataId, data string) { -// lw.resultChan <- watch.Event{ -// Type: watch.Modified, -// Object: lw.newMappingResource(res.Spec.ServiceName, strings.Split(data, constants.CommaSeparator)), -// } -// }, -// }) -// if err != nil { -// return bizerror.Wrap(err, bizerror.NacosError, fmt.Sprintf("cannot watch mapping %s", res.Name)) -// } -// return nil -//} - -func (lw *MappingListerWatcher) ResourceKind() coremodel.ResourceKind { - return meshresource.ServiceProviderMappingKind -} - -func (lw *MappingListerWatcher) newMappingResource( - serviceName string, - appNames []string) *meshresource.ServiceProviderMappingResource { - mappingRes := meshresource.NewServiceProviderMappingResourceWithAttributes(serviceName, lw.cfg.Name) - mappingRes.Spec = &meshproto.ServiceProviderMapping{ - ServiceName: serviceName, - AppNames: appNames, - } - return mappingRes -} - -func (lw *MappingListerWatcher) Stop() { - lw.stopWatch = true -} - -func (lw *MappingListerWatcher) ResultChan() <-chan watch.Event { - return lw.resultChan -} - -func (lw *MappingListerWatcher) TransformFunc() cache.TransformFunc { - return nil -} diff --git a/pkg/discovery/nacos2/listerwatcher/nacos_config.go b/pkg/discovery/nacos2/listerwatcher/nacos_config.go new file mode 100644 index 000000000..05c2262b8 --- /dev/null +++ b/pkg/discovery/nacos2/listerwatcher/nacos_config.go @@ -0,0 +1,292 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package listerwatcher + +import ( + "fmt" + "time" + + "github.com/duke-git/lancet/v2/convertor" + "github.com/go-co-op/gocron" + nacosconfigclient "github.com/nacos-group/nacos-sdk-go/v2/clients/config_client" + nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" + nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" + + "github.com/apache/dubbo-admin/pkg/common/bizerror" + discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" + "github.com/apache/dubbo-admin/pkg/core/logger" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" +) + +type ConfigToResourceFunc func(mesh string, dataId string, content string) coremodel.Resource + +type ConfigListerWatcher[T coremodel.Resource] struct { + rk coremodel.ResourceKind + cfg *discoverycfg.Config + configClient nacosconfigclient.IConfigClient + resultChan chan watch.Event + // watchingCfg is used to record the configs that are currently being watched + // key-> dataId, value-> true if it is watched in current list turn + watchingCfg map[string]bool + scheduler *gocron.Scheduler + newResListFunc coremodel.NewResourceListFunc + toResourceFunc ConfigToResourceFunc + blurSearch bool + searchExpr string + nacosGroup string + stopWatch bool +} + +func NewConfigListerWatcher( + rk coremodel.ResourceKind, + cfg *discoverycfg.Config, + configClient nacosconfigclient.IConfigClient, + toResourceFunc ConfigToResourceFunc, + blurSearch bool, + searchExpr string, + nacosGroup string, +) (*ConfigListerWatcher[coremodel.Resource], error) { + listFunc, err := coremodel.ResourceSchemaRegistry().NewResourceListFunc(rk) + if err != nil { + return nil, bizerror.Wrap(err, bizerror.UnknownError, + fmt.Sprintf("get resource schema failed, cause: %s", err.Error())) + } + return &ConfigListerWatcher[coremodel.Resource]{ + rk: rk, + cfg: cfg, + configClient: configClient, + resultChan: make(chan watch.Event), + watchingCfg: make(map[string]bool), + scheduler: gocron.NewScheduler(time.UTC), + newResListFunc: listFunc, + toResourceFunc: toResourceFunc, + blurSearch: blurSearch, + searchExpr: searchExpr, + nacosGroup: nacosGroup, + stopWatch: false, + }, nil +} + +func (lw *ConfigListerWatcher[T]) List(_ metav1.ListOptions) (k8sruntime.Object, error) { + resList := lw.newResListFunc() + configs, err := lw.fetchAllConfigs() + if err != nil { + return nil, err + } + resList.SetItems(configs) + return resList, nil +} + +func (lw *ConfigListerWatcher[T]) Watch(_ metav1.ListOptions) (watch.Interface, error) { + _, err := lw.scheduler.Every(lw.cfg.Properties.ConfigWatchPeriod).Seconds().Do(func() { + if lw.stopWatch { + logger.Debugf("stop watching %s in nacos %s", lw.rk, lw.nacosAddress()) + lw.scheduler.Stop() + } + startTime := time.Now() + logger.Debugf("start fetching and processing all %s in nacos %s at %s", lw.rk, lw.nacosAddress(), startTime) + err := lw.fetchAndProcessConfigs() + if err != nil { + logger.Errorf("fetchAndProcessConfigs %s in nacos %s failed, cause: %s", lw.rk, lw.nacosAddress(), err.Error()) + return + } + costs := time.Now().UnixMilli() - startTime.UnixMilli() + logger.Debugf("fetchAndProcessConfigs succeed %s in nacos %s, costs %dms", lw.rk, lw.nacosAddress(), costs) + + }) + if err != nil { + return nil, bizerror.Wrap(err, bizerror.UnknownError, + fmt.Sprintf("fetch all metadata of nacos %s in a schedule occurs error", lw.nacosAddress())) + } + lw.scheduler.StartAsync() + return lw, nil +} + +func (lw *ConfigListerWatcher[T]) fetchAllConfigs() ([]coremodel.Resource, error) { + configList := make([]coremodel.Resource, 0) + pageNum := 1 + pageSize := 100 + // list all configs by page search + for { + configPage, err := lw.listPage(pageNum, pageSize) + if err != nil { + return nil, err + } + for _, item := range configPage.PageItems { + r := lw.toResourceFunc(lw.mesh(), item.DataId, item.Content) + if r == nil { + logger.Warnf("config %s convert to %s failed in %s, raw content: %s", item.DataId, lw.rk, lw.nacosAddress(), item.Content) + continue + } + configList = append(configList, r) + } + if configPage.TotalCount <= pageNum*pageSize { + break + } + pageNum++ + } + return configList, nil +} + +func (lw *ConfigListerWatcher[T]) fetchAndProcessConfigs() error { + pageNum := 1 + pageSize := 50 + // list all configs by page search + for { + configPage, err := lw.listPage(pageNum, pageSize) + if err != nil { + return err + } + for _, item := range configPage.PageItems { + lw.processConfig(item) + } + if configPage.TotalCount <= pageNum*pageSize { + break + } + pageNum++ + } + // remove listeners for configs that are not watched in current turn + for dataId, watched := range lw.watchingCfg { + if watched { + lw.watchingCfg[dataId] = false + continue + } + err := lw.unsubscribeConfig(dataId, lw.nacosGroup) + if err != nil { + logger.Errorf("unsubscribe failed, cause: %s", err) + continue + } + // only one go routine, thread safe + delete(lw.watchingCfg, dataId) + } + return nil +} + +func (lw *ConfigListerWatcher[T]) subscribeConfig(configKey string, group string) error { + logger.Infof("subscribe config %s in nacos %s", configKey, lw.nacosAddress()) + err := lw.configClient.ListenConfig(nacosvo.ConfigParam{ + DataId: configKey, + Group: group, + OnChange: func(namespace string, group string, dataId string, content string) { + lw.resultChan <- watch.Event{ + Type: watch.Modified, + Object: lw.toResourceFunc(lw.mesh(), dataId, content), + } + }, + }) + if err != nil { + return bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("subscribe config %s failed in nacos %s", configKey, lw.nacosAddress())) + } + return nil +} + +func (lw *ConfigListerWatcher[T]) unsubscribeConfig(configKey string, group string) error { + logger.Infof("unsubscribe config %s in nacos %s", configKey, lw.nacosAddress()) + err := lw.configClient.CancelListenConfig(nacosvo.ConfigParam{ + DataId: configKey, + Group: group, + }) + lw.resultChan <- watch.Event{ + Type: watch.Deleted, + Object: lw.toResourceFunc(lw.mesh(), configKey, ""), + } + if err != nil { + return bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("unsubscribe config %s failed in nacos %s", configKey, lw.nacosAddress())) + } + return nil +} + +func (lw *ConfigListerWatcher[T]) listPage(pageNum int, pageSize int) (*nacosmodel.ConfigPage, error) { + var searchOp string + if lw.blurSearch { + searchOp = "blur" + } else { + searchOp = "accurate" + } + configPage, err := lw.configClient.SearchConfig(nacosvo.SearchConfigParam{ + Search: searchOp, + DataId: lw.searchExpr, + Group: lw.nacosGroup, + PageNo: pageNum, + PageSize: pageSize, + }) + if err != nil { + errMsg := fmt.Sprintf("cannot do page list of config, page size %d, page num %d, nacos address %s", + pageSize, pageNum, lw.nacosAddress()) + return nil, bizerror.Wrap(err, bizerror.NacosError, errMsg) + } + logger.Debugf("list config page, page size %d, page num %d, nacos address %s, total count %d, items %s", + pageSize, pageNum, lw.nacosAddress(), configPage.TotalCount, convertor.ToString(configPage.PageItems)) + return configPage, nil +} + +func (lw *ConfigListerWatcher[T]) processConfig(item nacosmodel.ConfigItem) { + // convert to resource + res := lw.toResourceFunc(lw.mesh(), item.DataId, item.Content) + // if resource is nil, skip the event emitting and other operations + if res == nil { + logger.Warnf("config %s to resource failed, raw content: %s, deleting %s in store", item.DataId, item.Content) + return + } + // emit event + lw.resultChan <- watch.Event{ + Type: watch.Modified, + Object: res, + } + // subscribe config if not watched + if _, exists := lw.watchingCfg[item.DataId]; exists { + lw.watchingCfg[item.DataId] = true + return + } + err := lw.subscribeConfig(item.DataId, item.Group) + if err != nil { + logger.Errorf("subscribe config %s failed in nacos %s, cause: %v", item.DataId, lw.nacosAddress(), err) + return + } + lw.watchingCfg[item.DataId] = true +} + +func (lw *ConfigListerWatcher[T]) ResourceKind() coremodel.ResourceKind { + return lw.rk +} + +func (lw *ConfigListerWatcher[T]) Stop() { + lw.stopWatch = true +} + +func (lw *ConfigListerWatcher[T]) ResultChan() <-chan watch.Event { + return lw.resultChan +} + +func (lw *ConfigListerWatcher[T]) TransformFunc() cache.TransformFunc { + return nil +} + +func (lw *ConfigListerWatcher[T]) nacosAddress() string { + return lw.cfg.Address.ConfigCenter +} + +func (lw *ConfigListerWatcher[T]) mesh() string { + return lw.cfg.Name +} diff --git a/pkg/discovery/nacos2/listerwatcher/nacos_service.go b/pkg/discovery/nacos2/listerwatcher/nacos_service.go new file mode 100644 index 000000000..bd5a842cd --- /dev/null +++ b/pkg/discovery/nacos2/listerwatcher/nacos_service.go @@ -0,0 +1,273 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by servicelicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package listerwatcher + +import ( + "fmt" + "time" + + "github.com/duke-git/lancet/v2/slice" + "github.com/go-co-op/gocron" + nacosnamingclient "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client" + nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" + nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sruntime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" + + meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" + "github.com/apache/dubbo-admin/pkg/common/bizerror" + discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" + "github.com/apache/dubbo-admin/pkg/core/logger" + meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" + coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" +) + +type NacosServiceListerWatcher struct { + cfg *discoverycfg.Config + namingClient nacosnamingclient.INamingClient + // watchingServices is used to record the services that are currently being watched + // key -> nacos service name, value -> true if it is watched in current list turn + watchingServices map[string]bool + scheduler *gocron.Scheduler + resultChan chan watch.Event + stopWatch bool +} + +func NewNacosServiceListerWatcher(cfg *discoverycfg.Config, namingClient nacosnamingclient.INamingClient) *NacosServiceListerWatcher { + return &NacosServiceListerWatcher{ + cfg: cfg, + namingClient: namingClient, + resultChan: make(chan watch.Event), + watchingServices: make(map[string]bool), + scheduler: gocron.NewScheduler(time.UTC), + stopWatch: false, + } +} + +func (lw *NacosServiceListerWatcher) List(_ metav1.ListOptions) (k8sruntime.Object, error) { + serviceNames, err := lw.fetchAllServiceNames() + if err != nil { + return nil, err + } + nacosServiceList := meshresource.NewNacosServiceResourceListWithItems() + resList := make([]*meshresource.NacosServiceResource, 0) + for _, serviceName := range serviceNames { + service, err := lw.namingClient.GetService(nacosvo.GetServiceParam{ + ServiceName: serviceName, + }) + if err != nil { + logger.Errorf("get instances of service %s failed in nacos %s, cause: %v", serviceName, lw.nacosAddress(), err) + continue + } + resList = append(resList, lw.toNacosServiceResource(serviceName, service.Hosts)) + } + nacosServiceList.Items = resList + return nacosServiceList, nil +} + +func (lw *NacosServiceListerWatcher) Watch(_ metav1.ListOptions) (watch.Interface, error) { + _, err := lw.scheduler.Every(lw.cfg.Properties.ServiceWatchPeriod).Seconds().Do(func() { + if lw.stopWatch { + logger.Debugf("stop watch all services of nacos %s", lw.mesh()) + lw.scheduler.Stop() + return + } + startTime := time.Now() + err := lw.fetchAndProcessService() + if err != nil { + logger.Errorf("fetch all service failed in nacos %s, cause: %v", lw.nacosAddress(), err) + return + } + costs := time.Now().UnixMilli() - startTime.UnixMilli() + logger.Debugf("finish fetching and processing all services in nacos %s, costs %dms", lw.nacosAddress(), costs) + }) + if err != nil { + return nil, bizerror.Wrap(err, bizerror.UnknownError, + fmt.Sprintf("watch all services of nacos %s in a schedule occurs error", lw.mesh())) + } + lw.scheduler.StartAsync() + return lw, nil +} + +func (lw *NacosServiceListerWatcher) fetchAllServiceNames() ([]string, error) { + serviceNameList := make([]string, 0) + var pageNum uint32 = 1 + var pageSize uint32 = 100 + // If the number of serviceInfos is less than the page size, it means that the last page has been reached + for { + serviceNames, err := lw.listPage(pageNum, pageSize) + if err != nil { + return nil, err + } + serviceNameList = append(serviceNameList, serviceNames...) + if len(serviceNames) <= int(pageNum*pageSize) { + break + } + pageNum++ + } + return serviceNameList, nil +} + +func (lw *NacosServiceListerWatcher) fetchAndProcessService() error { + var pageNum uint32 = 1 + var pageSize uint32 = 100 + // list all services by page search and subscribe it + for { + serviceNames, err := lw.listPage(pageNum, pageSize) + if err != nil { + return err + } + slice.ForEach(serviceNames, func(index int, item string) { + lw.processNacosService(item) + }) + if len(serviceNames) <= int(pageNum*pageSize) { + break + } + pageNum++ + } + // remove subscribers for services that are no longer being watched + for serviceName, watched := range lw.watchingServices { + if watched { + lw.watchingServices[serviceName] = false + continue + } + err := lw.unsubscribeService(serviceName) + if err != nil { + logger.Errorf("unsubscribe service %s failed in nacos %s, cause: %v", serviceName, lw.nacosAddress(), err) + continue + } + // delete service from watchingServices, only one go routine, thread safe + delete(lw.watchingServices, serviceName) + } + return nil +} + +func (lw *NacosServiceListerWatcher) processNacosService(serviceName string) { + if _, exists := lw.watchingServices[serviceName]; exists { + lw.watchingServices[serviceName] = true + return + } + err := lw.subscribeService(serviceName) + if err != nil { + logger.Errorf("subscribe service %s failed in nacos %s, cause: %v", serviceName, lw.nacosAddress(), err) + return + } + lw.watchingServices[serviceName] = true +} + +func (lw *NacosServiceListerWatcher) listPage(pageNo, pageSize uint32) ([]string, error) { + serviceNames := make([]string, 0, pageSize) + serviceInfos, err := lw.namingClient.GetAllServicesInfo(nacosvo.GetAllServiceInfoParam{ + PageSize: pageSize, + PageNo: pageNo, + }) + + if err != nil { + return nil, bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("get service names failed in nacos %s failed, page size: %d, page num: %d", lw.nacosAddress(), pageSize, pageNo)) + } + serviceNames = append(serviceNames, serviceInfos.Doms...) + + return serviceNames, nil +} + +func (lw *NacosServiceListerWatcher) subscribeService(serviceName string) error { + logger.Infof("subscribe service %s in nacos %s", serviceName, lw.mesh()) + err := lw.namingClient.Subscribe(&nacosvo.SubscribeParam{ + ServiceName: serviceName, + SubscribeCallback: func(instances []nacosmodel.Instance, err error) { + if err != nil { + logger.Errorf("subscribe service %s failed in nacos %s, cause: %v", serviceName, lw.nacosAddress(), err) + return + } + lw.resultChan <- watch.Event{ + Type: watch.Modified, + Object: lw.toNacosServiceResource(serviceName, instances), + } + }, + }) + if err != nil { + return bizerror.Wrap(err, bizerror.NacosError, + fmt.Sprintf("subscribe service %s failed in nacos %s", serviceName, lw.mesh())) + } + return nil +} + +func (lw *NacosServiceListerWatcher) unsubscribeService(serviceName string) error { + logger.Infof("unsubscribe service %s in nacos %s", serviceName, lw.mesh()) + lw.resultChan <- watch.Event{ + Type: watch.Deleted, + Object: lw.toNacosServiceResource(serviceName, []nacosmodel.Instance{}), + } + return lw.namingClient.Unsubscribe(&nacosvo.SubscribeParam{ + ServiceName: serviceName, + GroupName: "DEFAULT_GROUP", + SubscribeCallback: func(instances []nacosmodel.Instance, err error) { + if err != nil { + logger.Errorf("unsubscribe service %s failed in nacos %s, cause: %v", serviceName, lw.nacosAddress(), err) + return + } + lw.resultChan <- watch.Event{ + Type: watch.Deleted, + Object: lw.toNacosServiceResource(serviceName, instances), + } + }, + }) +} + +func (lw *NacosServiceListerWatcher) toNacosServiceResource(serviceName string, instances []nacosmodel.Instance) *meshresource.NacosServiceResource { + resource := meshresource.NewNacosServiceResourceWithAttributes(serviceName, lw.cfg.Name) + nacosInstances := slice.Map(instances, func(index int, item nacosmodel.Instance) *meshproto.NacosInstance { + return &meshproto.NacosInstance{ + Ip: item.Ip, + Port: int64(item.Port), + Metadata: item.Metadata, + } + }) + resource.Spec = &meshproto.NacosService{ + ServiceKey: serviceName, + Instances: nacosInstances, + } + return resource +} + +func (lw *NacosServiceListerWatcher) ResourceKind() coremodel.ResourceKind { + return meshresource.NacosServiceKind +} + +func (lw *NacosServiceListerWatcher) TransformFunc() cache.TransformFunc { + return nil +} + +func (lw *NacosServiceListerWatcher) Stop() { + lw.stopWatch = true +} + +func (lw *NacosServiceListerWatcher) ResultChan() <-chan watch.Event { + return lw.resultChan +} + +func (lw *NacosServiceListerWatcher) nacosAddress() string { + return lw.cfg.Address.Registry +} + +func (lw *NacosServiceListerWatcher) mesh() string { + return lw.cfg.Name +} diff --git a/pkg/discovery/nacos2/listerwatcher/rpc_instance.go b/pkg/discovery/nacos2/listerwatcher/rpc_instance.go deleted file mode 100644 index da2c4ceec..000000000 --- a/pkg/discovery/nacos2/listerwatcher/rpc_instance.go +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package listerwatcher - -import ( - "encoding/json" - "fmt" - "regexp" - "strconv" - "time" - - set "github.com/duke-git/lancet/v2/datastructure/set" - "github.com/duke-git/lancet/v2/datetime" - "github.com/duke-git/lancet/v2/maputil" - "github.com/duke-git/lancet/v2/slice" - "github.com/go-co-op/gocron" - nacosnamingclient "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client" - nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" - nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - k8sruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" - - meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" - "github.com/apache/dubbo-admin/pkg/common/bizerror" - "github.com/apache/dubbo-admin/pkg/common/constants" - discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" - "github.com/apache/dubbo-admin/pkg/core/logger" - meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" - coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" -) - -type RPCInstanceListerWatcher struct { - cfg *discoverycfg.Config - namingClient nacosnamingclient.INamingClient - watchingApps set.Set[string] - scheduler *gocron.Scheduler - resultChan chan watch.Event - stopWatch bool -} - -func NewRPCInstanceListerWatcher(cfg *discoverycfg.Config, namingClient nacosnamingclient.INamingClient) *RPCInstanceListerWatcher { - return &RPCInstanceListerWatcher{ - cfg: cfg, - namingClient: namingClient, - resultChan: make(chan watch.Event), - watchingApps: set.New[string](), - scheduler: gocron.NewScheduler(time.UTC), - stopWatch: false, - } -} - -func (lw *RPCInstanceListerWatcher) List(_ metav1.ListOptions) (k8sruntime.Object, error) { - appNames, err := lw.fetchAllAppNames() - if err != nil { - return nil, err - } - resourceListObj := meshresource.NewRPCInstanceResourceList() - resList := make([]meshresource.RPCInstanceResource, 0) - for _, appName := range appNames { - appInstances, err := lw.namingClient.GetService(nacosvo.GetServiceParam{ - ServiceName: appName, - }) - if err != nil { - logger.Errorf("get instances of app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) - continue - } - for _, instance := range appInstances.Hosts { - resList = append(resList, *lw.toRPCInstanceResource(appName, instance)) - } - } - resourceListObj.Items = resList - return resourceListObj, nil -} - -func (lw *RPCInstanceListerWatcher) Watch(_ metav1.ListOptions) (watch.Interface, error) { - _, err := lw.scheduler.Every(lw.cfg.Properties.ServiceWatchPeriod).Seconds().Do(func() { - if lw.stopWatch { - logger.Debugf("stop watch all rpc instances of nacos %s", lw.cfg.Address.Registry) - lw.scheduler.Stop() - return - } - startTime := time.Now() - logger.Debugf("start fetching all rpc instances in nacos %s at %s", lw.cfg.Address.Registry, startTime) - appNames, err := lw.fetchAllAppNames() - if err != nil { - logger.Errorf("fetch all app names failed in nacos %s, cause: %v", lw.cfg.Address.Registry, err) - return - } - costs := time.Now().UnixMilli() - startTime.UnixMilli() - logger.Debugf("finish fetching all rpc instances in nacos %s, costs %dms", lw.cfg.Address.Registry, costs) - newAppNames := set.FromSlice(appNames) - offlineAppNames := lw.watchingApps.Minus(newAppNames) - for _, appName := range offlineAppNames.ToSlice() { - err := lw.unsubscribeApp(appName) - if err != nil { - logger.Errorf("unsubscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) - } - lw.watchingApps.Delete(appName) - continue - } - for _, appName := range newAppNames.ToSlice() { - exist := lw.watchingApps.AddIfNotExist(appName) - if exist { - continue - } - err := lw.subscribeApp(appName) - if err != nil { - logger.Errorf("subscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) - } - } - }) - if err != nil { - return nil, bizerror.Wrap(err, bizerror.UnknownError, - fmt.Sprintf("watch all mappings of nacos %s in a schedule occurs error", lw.cfg.Address.Registry)) - } - lw.scheduler.StartAsync() - return lw, nil -} - -func (lw *RPCInstanceListerWatcher) fetchAllAppNames() ([]string, error) { - appNames := make([]string, 0) - // filter out interface-level provider metadata dataIds - const providerPattern = `^providers:[\w\.]+(?::[\w\.]*:|::[\w\.]*)?$` - providerRe := regexp.MustCompile(providerPattern) - // filter out consumer metadata dataIds - const consumerPattern = `^consumers:[\w\.]+(?::[\w\.]*:|::[\w\.]*)?$` - consumerRe := regexp.MustCompile(consumerPattern) - var pageSize uint32 = 100 - for pageNum := uint32(1); ; pageNum++ { - appInfos, err := lw.namingClient.GetAllServicesInfo(nacosvo.GetAllServiceInfoParam{ - PageSize: pageSize, - PageNo: pageNum, - }) - - if err != nil { - return nil, bizerror.Wrap(err, bizerror.NacosError, - fmt.Sprintf("get app names failed in nacos %s failed, page size: %d, page num: %d", lw.cfg.Address.Registry, pageSize, pageNum)) - } - for _, e := range appInfos.Doms { - if !providerRe.MatchString(e) && !consumerRe.MatchString(e) { - appNames = append(appNames, e) - } - } - // If the number of appInfos is less than the page size, it means that the last page has been reached - if appInfos.Count < int64(pageSize) { - return appNames, nil - } - } -} - -func (lw *RPCInstanceListerWatcher) subscribeApp(appName string) error { - err := lw.namingClient.Subscribe(&nacosvo.SubscribeParam{ - ServiceName: appName, - SubscribeCallback: func(instances []nacosmodel.Instance, err error) { - if err != nil { - logger.Errorf("subscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) - return - } - slice.ForEach(instances, func(index int, instance nacosmodel.Instance) { - lw.resultChan <- watch.Event{ - Type: watch.Deleted, Object: lw.toRPCInstanceResource(appName, instance)} - }) - }, - }) - if err != nil { - return bizerror.Wrap(err, bizerror.NacosError, - fmt.Sprintf("subscribe app %s failed in nacos %s", appName, lw.cfg.Address.Registry)) - } - lw.watchingApps.Add(appName) - return nil -} - -func (lw *RPCInstanceListerWatcher) unsubscribeApp(appName string) error { - return lw.namingClient.Unsubscribe(&nacosvo.SubscribeParam{ - ServiceName: appName, - SubscribeCallback: func(instances []nacosmodel.Instance, err error) { - if err != nil { - logger.Errorf("unsubscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) - return - } - }, - }) -} - -func (lw *RPCInstanceListerWatcher) toRPCInstanceResource(appName string, instance nacosmodel.Instance) *meshresource.RPCInstanceResource { - resName := meshresource.BuildInstanceResName(appName, instance.Ip, int64(instance.Port)) - res := meshresource.NewRPCInstanceResourceWithAttributes(resName, lw.cfg.Name) - var registerTime string - timestamp, err := strconv.ParseInt(instance.Metadata[constants.TimestampKey], 10, 64) - if err != nil { - registerTime = "" - } else { - registerTime = datetime.FormatTimeToStr(time.UnixMilli(timestamp), "2006-01-02 15:04:05") - } - revision := instance.Metadata[constants.MetadataRevisionKey] - metadataStorageType := instance.Metadata[constants.MetadataStorageTypeKey] - urlParams, exists := instance.Metadata[constants.URLParamsKey] - relaseVersion := "" - protocol := "" - serialization := "" - preferSerialization := "" - if exists { - paramsMap := make(map[string]string) - err := json.Unmarshal([]byte(urlParams), ¶msMap) - if err != nil { - logger.Warnf("parse url params failed, raw url params string: %s, cause: %v", urlParams, err) - } - relaseVersion = paramsMap[constants.ReleaseKey] - protocol = paramsMap[constants.DubboVersionKey] - serialization = paramsMap[constants.SerializationKey] - preferSerialization = paramsMap[constants.SerializationKey] - - } - var endpoints []*meshproto.Endpoint - err = json.Unmarshal([]byte(instance.Metadata[constants.EndpointsKey]), &endpoints) - if err != nil { - logger.Warnf("parse endpoints failed, raw endpoints string: %s, cause: %v", instance.Metadata[constants.EndpointsKey], err) - } - res.Spec = &meshproto.RPCInstance{ - Name: resName, - AppName: appName, - Ip: instance.Ip, - Port: int64(instance.Port), - RegisterTime: registerTime, - UnregisterTime: "", - Revision: revision, - MetadataStorageType: metadataStorageType, - ReleaseVersion: relaseVersion, - Protocol: protocol, - Serialization: serialization, - PreferSerialization: preferSerialization, - Tags: getRPCInstanceTags(instance.Metadata), - Endpoints: endpoints, - Metadata: instance.Metadata, - } - return res -} - -func getRPCInstanceTags(metadata map[string]string) map[string]string { - knownKeys := set.New[string](constants.URLParamsKey, constants.EndpointsKey, - constants.MetadataRevisionKey, constants.MetadataStorageTypeKey, constants.TimestampKey) - return maputil.Filter(metadata, func(key string, value string) bool { - return !knownKeys.Contain(key) - }) -} - -func (lw *RPCInstanceListerWatcher) ResourceKind() coremodel.ResourceKind { - return meshresource.RPCInstanceKind -} - -func (lw *RPCInstanceListerWatcher) TransformFunc() cache.TransformFunc { - return nil -} - -func (lw *RPCInstanceListerWatcher) Stop() { - lw.stopWatch = true -} - -func (lw *RPCInstanceListerWatcher) ResultChan() <-chan watch.Event { - return lw.resultChan -} diff --git a/pkg/discovery/nacos2/listerwatcher/service_consumer_metadata.go b/pkg/discovery/nacos2/listerwatcher/service_consumer_metadata.go deleted file mode 100644 index 7bef9c8a8..000000000 --- a/pkg/discovery/nacos2/listerwatcher/service_consumer_metadata.go +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package listerwatcher - -import ( - "fmt" - "regexp" - "time" - - "github.com/duke-git/lancet/v2/convertor" - set "github.com/duke-git/lancet/v2/datastructure/set" - "github.com/duke-git/lancet/v2/slice" - "github.com/go-co-op/gocron" - nacosnamingclient "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client" - nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" - nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - k8sruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" - - meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" - "github.com/apache/dubbo-admin/pkg/common/bizerror" - "github.com/apache/dubbo-admin/pkg/common/constants" - discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" - "github.com/apache/dubbo-admin/pkg/core/logger" - meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" - coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" -) - -type ServiceConsumerMetadataListerWatcher struct { - cfg *discoverycfg.Config - namingClient nacosnamingclient.INamingClient - watchingConsumers set.Set[string] - scheduler *gocron.Scheduler - resultChan chan watch.Event - stopWatch bool -} - -func NewServiceConsumerMetadataListerWatcher( - cfg *discoverycfg.Config, - namingClient nacosnamingclient.INamingClient) *ServiceConsumerMetadataListerWatcher { - return &ServiceConsumerMetadataListerWatcher{ - cfg: cfg, - namingClient: namingClient, - resultChan: make(chan watch.Event), - watchingConsumers: set.New[string](), - scheduler: gocron.NewScheduler(time.UTC), - stopWatch: false, - } -} - -func (lw *ServiceConsumerMetadataListerWatcher) List(_ metav1.ListOptions) (k8sruntime.Object, error) { - consumerKeys, err := lw.fetchAllServiceConsumerKeys() - if err != nil { - return nil, err - } - resListObj := meshresource.NewServiceConsumerMetadataResourceList() - resList := make([]meshresource.ServiceConsumerMetadataResource, 0) - for _, ck := range consumerKeys { - consumers, err := lw.namingClient.GetService(nacosvo.GetServiceParam{ - ServiceName: ck, - }) - if err != nil { - logger.Errorf("get service consumers %s failed in nacos %s, cause: %v", ck, lw.cfg.Address.Registry, err) - continue - } - for _, consumer := range consumers.Hosts { - res := lw.toServiceConsumerMetadataResource(ck, consumer) - if res != nil { - resList = append(resList, *res) - } - } - } - resListObj.Items = resList - return resListObj, nil -} - -func (lw *ServiceConsumerMetadataListerWatcher) Watch(_ metav1.ListOptions) (watch.Interface, error) { - _, err := lw.scheduler.Every(lw.cfg.Properties.ConfigWatchPeriod).Seconds().Do(func() { - if lw.stopWatch { - logger.Debugf("stop watch all service consumer metadata of nacos %s", lw.cfg.Address) - lw.scheduler.Stop() - return - } - startTime := time.Now() - logger.Debugf("start fetching all service consumer metadata in nacos %s at %s", lw.cfg.Address.Registry, startTime) - serviceConsumerNames, err := lw.fetchAllServiceConsumerKeys() - if err != nil { - logger.Errorf("fetch all service consumer failed in nacos %s, cause: %v", lw.cfg.Address.Registry, err) - return - } - costs := time.Now().UnixMilli() - startTime.UnixMilli() - logger.Debugf("fetch all service consumer metadata in nacos %s succeed, costs %dms", lw.cfg.Address.Registry, costs) - newConsumers := set.FromSlice(serviceConsumerNames) - offlineConsumers := lw.watchingConsumers.Minus(newConsumers) - for _, consumerName := range offlineConsumers.ToSlice() { - err := lw.unsubscribeServiceConsumer(consumerName) - if err != nil { - logger.Errorf("unsubscribe service consumer %s failed in nacos %s, cause: %v", - consumerName, lw.cfg.Address.Registry, err) - } - lw.watchingConsumers.Delete(consumerName) - logger.Debugf("unsubscribe service consumer %s succeed in nacos %s", consumerName, lw.cfg.Address.Registry) - continue - } - for _, consumerName := range newConsumers.ToSlice() { - exist := lw.watchingConsumers.AddIfNotExist(consumerName) - if exist { - continue - } - err := lw.subscribeServiceConsumer(consumerName) - if err != nil { - logger.Errorf("subscribe service consumer %s failed in nacos %s, cause: %v", consumerName, lw.cfg.Address.Registry, err) - } - } - }) - if err != nil { - return nil, bizerror.Wrap(err, bizerror.UnknownError, - fmt.Sprintf("watch all mappings of nacos %s in a schedule occurs error", lw.cfg.Address)) - } - lw.scheduler.StartAsync() - return lw, nil -} - -func (lw *ServiceConsumerMetadataListerWatcher) fetchAllServiceConsumerKeys() ([]string, error) { - allKeys := make([]string, 0) - //Filter out interface-level DataIds - const pattern = `^consumers:[\w\.]+(?::[\w\.]*:|::[\w\.]*)?$` - re := regexp.MustCompile(pattern) - var pageSize uint32 = 100 - for pageNum := uint32(1); ; pageNum++ { - consumerKeys, err := lw.namingClient.GetAllServicesInfo(nacosvo.GetAllServiceInfoParam{ - PageSize: pageSize, - PageNo: pageNum, - }) - - if err != nil { - return nil, bizerror.Wrap(err, bizerror.NacosError, - fmt.Sprintf("get service consumer keys failed in nacos %s failed, page size: %d, page num: %d", - lw.cfg.Address, pageSize, pageNum)) - } - for _, key := range consumerKeys.Doms { - if re.MatchString(key) { - allKeys = append(allKeys, key) - } - } - // If the number of consumerKeys is less than the page size, it means that the last page has been reached - if consumerKeys.Count < int64(pageSize) { - return allKeys, nil - } - } -} - -func (lw *ServiceConsumerMetadataListerWatcher) subscribeServiceConsumer(consumerKey string) error { - err := lw.namingClient.Subscribe(&nacosvo.SubscribeParam{ - ServiceName: consumerKey, - SubscribeCallback: func(instances []nacosmodel.Instance, err error) { - if err != nil { - logger.Errorf("subscribe service consumer %s failed in nacos %s, cause: %v", - consumerKey, lw.cfg.Address.Registry, err) - return - } - slice.ForEach(instances, func(index int, instance nacosmodel.Instance) { - lw.resultChan <- watch.Event{ - Type: watch.Modified, Object: lw.toServiceConsumerMetadataResource(consumerKey, instance)} - }) - }, - }) - if err != nil { - return bizerror.Wrap(err, bizerror.NacosError, - fmt.Sprintf("subscribe service consumer %s failed in nacos %s", consumerKey, lw.cfg.Address.Registry)) - } - return nil -} - -func (lw *ServiceConsumerMetadataListerWatcher) unsubscribeServiceConsumer(appName string) error { - return lw.namingClient.Unsubscribe(&nacosvo.SubscribeParam{ - ServiceName: appName, - SubscribeCallback: func(instances []nacosmodel.Instance, err error) { - if err != nil { - logger.Errorf("unsubscribe app %s failed in nacos %s, cause: %v", appName, lw.cfg.Address.Registry, err) - return - } - }, - }) -} - -func (lw *ServiceConsumerMetadataListerWatcher) toServiceConsumerMetadataResource(consumerKey string, instance nacosmodel.Instance) *meshresource.ServiceConsumerMetadataResource { - metadataJsonStr, err := convertor.ToJson(instance.Metadata) - if err != nil { - logger.Errorf("skipping convert service consumer %s:%d of %s to ServiceConsumerMetadata "+ - "because it cannot convert to json string", instance.Ip, instance.Port, consumerKey) - return nil - } - consumerAppName, exists := instance.Metadata[constants.Application] - if !exists { - logger.Errorf("service consumer %s:%d of %s is invalid because no application name found, raw metadata: %s", - instance.Ip, instance.Port, consumerKey, metadataJsonStr) - return nil - } - serviceName, exists := instance.Metadata[constants.InterfaceKey] - if !exists { - logger.Errorf("service consumer %s:%d of %s is invalid because no service name found, raw metadata: %s", - instance.Ip, instance.Port, consumerKey, metadataJsonStr) - return nil - } - version := instance.Metadata[constants.VersionKey] - group := instance.Metadata[constants.GroupKey] - resKey := consumerAppName + ":" + consumerKey - res := meshresource.NewServiceConsumerMetadataResourceWithAttributes(resKey, lw.cfg.Name) - res.Spec = &meshproto.ServiceConsumerMetadata{ - ServiceName: serviceName, - ConsumerAppName: consumerAppName, - Version: version, - Group: group, - Metadata: instance.Metadata, - } - return res -} - -func (lw *ServiceConsumerMetadataListerWatcher) ResourceKind() coremodel.ResourceKind { - return meshresource.ServiceConsumerMetadataKind -} - -func (lw *ServiceConsumerMetadataListerWatcher) TransformFunc() cache.TransformFunc { - return nil -} - -func (lw *ServiceConsumerMetadataListerWatcher) Stop() { - lw.stopWatch = true -} - -func (lw *ServiceConsumerMetadataListerWatcher) ResultChan() <-chan watch.Event { - return lw.resultChan -} diff --git a/pkg/discovery/nacos2/listerwatcher/service_provider_metadata.go b/pkg/discovery/nacos2/listerwatcher/service_provider_metadata.go deleted file mode 100644 index 2f015ecf5..000000000 --- a/pkg/discovery/nacos2/listerwatcher/service_provider_metadata.go +++ /dev/null @@ -1,162 +0,0 @@ -package listerwatcher - -import ( - "encoding/json" - "fmt" - "time" - - "github.com/duke-git/lancet/v2/convertor" - "github.com/duke-git/lancet/v2/slice" - "github.com/go-co-op/gocron" - nacosconfigclient "github.com/nacos-group/nacos-sdk-go/v2/clients/config_client" - nacosmodel "github.com/nacos-group/nacos-sdk-go/v2/model" - nacosvo "github.com/nacos-group/nacos-sdk-go/v2/vo" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - k8sruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" - - meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1" - "github.com/apache/dubbo-admin/pkg/common/bizerror" - "github.com/apache/dubbo-admin/pkg/common/constants" - discoverycfg "github.com/apache/dubbo-admin/pkg/config/discovery" - "github.com/apache/dubbo-admin/pkg/core/logger" - meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" - coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model" -) - -const DubboGroup = "dubbo" - -type ServiceProviderMetadataListerWatcher struct { - cfg *discoverycfg.Config - configClient nacosconfigclient.IConfigClient - resultChan chan watch.Event - scheduler *gocron.Scheduler - stopWatch bool -} - -func NewServiceProviderMetadataListerWatcher( - cfg *discoverycfg.Config, - configClient nacosconfigclient.IConfigClient, -) *ServiceProviderMetadataListerWatcher { - return &ServiceProviderMetadataListerWatcher{ - cfg: cfg, - configClient: configClient, - resultChan: make(chan watch.Event), - scheduler: gocron.NewScheduler(time.UTC), - stopWatch: false, - } -} - -func (lw *ServiceProviderMetadataListerWatcher) List(_ metav1.ListOptions) (k8sruntime.Object, error) { - resList := meshresource.NewServiceProviderMetadataResourceList() - metadataResources, err := lw.fetchAllProviderMetadata() - if err != nil { - return nil, err - } - resList.Items = metadataResources - return resList, nil -} - -func (lw *ServiceProviderMetadataListerWatcher) Watch(_ metav1.ListOptions) (watch.Interface, error) { - _, err := lw.scheduler.Every(lw.cfg.Properties.ConfigWatchPeriod).Seconds().Do(func() { - if lw.stopWatch { - logger.Debugf("stop watching metadata in nacos %s", lw.cfg.Address.MetadataReport) - lw.scheduler.Stop() - } - startTime := time.Now() - logger.Debugf("start fetching all service provider metadata in nacos %s at %s", lw.cfg.Address.MetadataReport, startTime) - metadataResources, err := lw.fetchAllProviderMetadata() - if err != nil { - logger.Errorf("fetch all service provider metadata in nacos %s failed, cause: %s", lw.cfg.Address.MetadataReport, err.Error()) - return - } - costs := time.Now().UnixMilli() - startTime.UnixMilli() - logger.Debugf("fetched all service provider metadata in nacos %s, costs %dms", lw.cfg.Address.MetadataReport, costs) - slice.ForEach(metadataResources, func(index int, item meshresource.ServiceProviderMetadataResource) { - lw.resultChan <- watch.Event{ - Type: watch.Modified, - Object: &item, - } - }) - }) - if err != nil { - return nil, bizerror.Wrap(err, bizerror.UnknownError, - fmt.Sprintf("fetch all metadata of nacos %s in a schedule occurs error", lw.cfg.Address.MetadataReport)) - } - lw.scheduler.StartAsync() - return lw, nil -} - -func (lw *ServiceProviderMetadataListerWatcher) fetchAllProviderMetadata() ([]meshresource.ServiceProviderMetadataResource, error) { - listPage := func(pageNum int, pageSize int) (*nacosmodel.ConfigPage, error) { - configPage, err := lw.configClient.SearchConfig(nacosvo.SearchConfigParam{ - Search: "blur", - DataId: "*:provider:*", - Group: DubboGroup, - PageNo: pageNum, - PageSize: pageSize, - }) - if err != nil { - errMsg := fmt.Sprintf("cannot do page list of config, page size %d, page num %d, nacos address %s", - pageSize, pageNum, lw.cfg.Address.MetadataReport) - return nil, bizerror.Wrap(err, bizerror.NacosError, errMsg) - } - logger.Debugf("list config page, page size %d, page num %d, nacos address %s, total count %d, items %s", - pageSize, pageNum, lw.cfg.Address.MetadataReport, configPage.TotalCount, convertor.ToString(configPage.PageItems)) - return configPage, nil - } - resList := make([]meshresource.ServiceProviderMetadataResource, 0) - pageNum := 1 - pageSize := 50 - // list all metadata by page search - for { - configPage, err := listPage(pageNum, pageSize) - if err != nil { - return nil, err - } - for _, item := range configPage.PageItems { - res := lw.toMetadataResource(item) - if res != nil { - resList = append(resList, *res) - } - } - if configPage.TotalCount <= pageNum*pageSize { - break - } - pageNum++ - } - return resList, nil -} - -func (lw *ServiceProviderMetadataListerWatcher) ResourceKind() coremodel.ResourceKind { - return meshresource.ServiceProviderMetadataKind -} - -func (lw *ServiceProviderMetadataListerWatcher) toMetadataResource(configItem nacosmodel.ConfigItem) *meshresource.ServiceProviderMetadataResource { - metadataSpec := &meshproto.ServiceProviderMetadata{} - err := json.Unmarshal([]byte(configItem.Content), metadataSpec) - if err != nil { - logger.Errorf("failed to unmarshal provider service metadata %s, cause: %v", configItem.Content, err) - return nil - } - metadataSpec.ServiceName = metadataSpec.CanonicalName - metadataSpec.Version = metadataSpec.Parameters[constants.VersionKey] - metadataSpec.Group = metadataSpec.Parameters[constants.GroupKey] - - metadataRes := meshresource.NewServiceProviderMetadataResourceWithAttributes(configItem.DataId, lw.cfg.Name) - metadataRes.Spec = metadataSpec - return metadataRes -} - -func (lw *ServiceProviderMetadataListerWatcher) Stop() { - lw.stopWatch = true -} - -func (lw *ServiceProviderMetadataListerWatcher) ResultChan() <-chan watch.Event { - return lw.resultChan -} - -func (lw *ServiceProviderMetadataListerWatcher) TransformFunc() cache.TransformFunc { - return nil -} diff --git a/pkg/engine/kubernetes/listerwatcher/runtime_instance.go b/pkg/engine/kubernetes/listerwatcher/runtime_instance.go index d0289e4b5..4b3140278 100644 --- a/pkg/engine/kubernetes/listerwatcher/runtime_instance.go +++ b/pkg/engine/kubernetes/listerwatcher/runtime_instance.go @@ -36,7 +36,6 @@ import ( "github.com/apache/dubbo-admin/pkg/common/bizerror" "github.com/apache/dubbo-admin/pkg/common/constants" enginecfg "github.com/apache/dubbo-admin/pkg/config/engine" - "github.com/apache/dubbo-admin/pkg/core/consts" "github.com/apache/dubbo-admin/pkg/core/controller" "github.com/apache/dubbo-admin/pkg/core/logger" meshresource "github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1" @@ -97,13 +96,13 @@ func (p *PodListerWatcher) TransformFunc() cache.TransformFunc { rpcPort := p.getDubboRPCPort(pod) var startTime string if pod.Status.StartTime != nil { - startTime = pod.Status.StartTime.Format(consts.TimeFormatStr) + startTime = pod.Status.StartTime.Format(constants.TimeFormatStr) } - createTime := pod.CreationTimestamp.Format(consts.TimeFormatStr) + createTime := pod.CreationTimestamp.Format(constants.TimeFormatStr) readyTime := "" slice.ForEach(pod.Status.Conditions, func(_ int, c v1.PodCondition) { if c.Type == v1.PodReady && c.Status == v1.ConditionTrue { - readyTime = c.LastTransitionTime.Format(consts.TimeFormatStr) + readyTime = c.LastTransitionTime.Format(constants.TimeFormatStr) } }) phase := string(pod.Status.Phase) @@ -120,7 +119,7 @@ func (p *PodListerWatcher) TransformFunc() cache.TransformFunc { return &meshproto.Condition{ Type: string(c.Type), Status: string(c.Status), - LastTransitionTime: c.LastTransitionTime.Format(consts.TimeFormatStr), + LastTransitionTime: c.LastTransitionTime.Format(constants.TimeFormatStr), Reason: c.Reason, Message: c.Message, } diff --git a/pkg/engine/mock/factory.go b/pkg/engine/mock/factory.go new file mode 100644 index 000000000..39e676749 --- /dev/null +++ b/pkg/engine/mock/factory.go @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package mock + +import ( + enginecfg "github.com/apache/dubbo-admin/pkg/config/engine" + "github.com/apache/dubbo-admin/pkg/core/controller" + "github.com/apache/dubbo-admin/pkg/core/engine" +) + +func init() { + engine.RegisterFactory(&EngineFactory{}) +} + +var _ engine.Factory = &EngineFactory{} + +type EngineFactory struct{} + +func (e *EngineFactory) Support(typ enginecfg.Type) bool { + return enginecfg.Mock == typ +} + +func (e *EngineFactory) NewListWatchers(cfg *enginecfg.Config) ([]controller.ResourceListerWatcher, error) { + return make([]controller.ResourceListerWatcher, 0), nil +} diff --git a/pkg/store/dbcommon/gorm_store.go b/pkg/store/dbcommon/gorm_store.go index dd7d60784..ac237998b 100644 --- a/pkg/store/dbcommon/gorm_store.go +++ b/pkg/store/dbcommon/gorm_store.go @@ -18,7 +18,6 @@ package dbcommon import ( - "errors" "fmt" "reflect" "sort" @@ -175,10 +174,9 @@ func (gs *GormStore) Update(obj interface{}) error { result := db.Scopes(TableScope(gs.kind.ToString())).Model(&ResourceModel{}). Where("resource_key = ?", resource.ResourceKey()). Updates(map[string]interface{}{ - "name": m.Name, - "mesh": m.Mesh, - "data": m.Data, - "updated_at": m.UpdatedAt, + "name": m.Name, + "mesh": m.Mesh, + "data": m.Data, }) if result.Error != nil { @@ -279,7 +277,7 @@ func (gs *GormStore) GetByKey(key string) (item interface{}, exists bool, err er First(&m) if result.Error != nil { - if errors.Is(result.Error, gorm.ErrRecordNotFound) { + if result.Error.Error() == "record not found" { return nil, false, nil } return nil, false, result.Error diff --git a/pkg/store/dbcommon/model.go b/pkg/store/dbcommon/model.go index 53b54e941..96277a12e 100644 --- a/pkg/store/dbcommon/model.go +++ b/pkg/store/dbcommon/model.go @@ -33,14 +33,14 @@ import ( // Note: TableName() method is intentionally removed as GORM caches it. // Use TableScope() instead for dynamic table names. type ResourceModel struct { - ID uint `gorm:"primarykey"` // Auto-incrementing primary key - ResourceKey string `gorm:"uniqueIndex;not null"` // Unique identifier for the resource - ResourceKind string `gorm:"not null"` // Type of resource (e.g., "Application", "ServiceProviderMapping") - Name string `gorm:"index;not null"` // Resource name, indexed for fast lookups - Mesh string `gorm:"index;not null"` // Mesh identifier, indexed for filtering by mesh - Data []byte `gorm:"type:text;not null"` // JSON-encoded resource data - CreatedAt time.Time `gorm:"autoCreateTime"` // Automatically set on creation - UpdatedAt time.Time `gorm:"autoUpdateTime"` // Automatically updated on modification + ID uint `gorm:"primarykey"` // Auto-incrementing primary key + ResourceKey string `gorm:"type:varchar(255);uniqueIndex;not null"` // Unique identifier for the resource + ResourceKind string `gorm:"not null"` // Type of resource (e.g., "Application", "ServiceProviderMapping") + Name string `gorm:"index;not null"` // Resource name, indexed for fast lookups + Mesh string `gorm:"index;not null"` // Mesh identifier, indexed for filtering by mesh + Data []byte `gorm:"type:text;not null"` // JSON-encoded resource data + CreatedAt time.Time `gorm:"autoCreateTime"` // Automatically set on creation + UpdatedAt time.Time `gorm:"autoUpdateTime"` // Automatically updated on modification } // TableNameForKind returns the table name for a given ResourceKind diff --git a/scripts/resourcegen/gen.go b/scripts/resourcegen/gen.go index 80c1f6081..c4ea7c35c 100644 --- a/scripts/resourcegen/gen.go +++ b/scripts/resourcegen/gen.go @@ -78,7 +78,7 @@ import ( const {{.Name}}Kind coremodel.ResourceKind = "{{.Name}}" func init() { - coremodel.RegisterResourceSchema({{.Name}}Kind, New{{.Name}}Resource) + coremodel.RegisterResourceSchema({{.Name}}Kind, New{{.Name}}Resource, New{{.Name}}ResourceList) } type {{.Name}}Resource struct { @@ -180,7 +180,7 @@ func New{{.Name}}Resource() coremodel.Resource { type {{.Name}}ResourceList struct { metav1.TypeMeta {{ $tk }}json:",inline"{{ $tk }} metav1.ListMeta {{ $tk }}json:"metadata,omitempty"{{ $tk }} - Items []{{.Name}}Resource {{ $tk }}json:"items"{{ $tk }} + Items []*{{.Name}}Resource {{ $tk }}json:"items"{{ $tk }} } func (r *{{.Name}}ResourceList) DeepCopyObject() k8sruntime.Object { @@ -192,22 +192,44 @@ func (r *{{.Name}}ResourceList) DeepCopyObject() k8sruntime.Object { if len(r.Items) == 0 { return out } - out.Items = make([]{{.Name}}Resource, len(r.Items)) + out.Items = make([]*{{.Name}}Resource, len(r.Items)) for i := range r.Items { - out.Items[i] = *r.Items[i].DeepCopyObject().(*{{.Name}}Resource) + out.Items[i] = r.Items[i].DeepCopyObject().(*{{.Name}}Resource) } return out } -func New{{.Name}}ResourceList() *{{.Name}}ResourceList { +func New{{.Name}}ResourceList() coremodel.ResourceList { return &{{.Name}}ResourceList{ TypeMeta: metav1.TypeMeta{ Kind: string({{.Name}}Kind), APIVersion: "v1alpha1", }, + Items: make([]*{{.Name}}Resource, 0), } } +func (r *{{.Name}}ResourceList) SetItems(items []coremodel.Resource) { + r.Items = make([]*{{.Name}}Resource, len(items)) + for i := range items { + res, ok := items[i].(*{{.Name}}Resource) + if !ok{ + logger.Errorf("unexpected resource type, expected: %s, get %s", {{.Name}}Kind, res.ResourceKind()) + continue + } + r.Items[i] = res + } +} + +func New{{.Name}}ResourceListWithItems(items ...*{{.Name}}Resource) *{{.Name}}ResourceList { + return &{{.Name}}ResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: string({{.Name}}Kind), + APIVersion: "v1alpha1", + }, + Items: items, + } +} {{- end }} {{/* Resources */}} `)) From 711f62987f68ddc4454ed17c4020bb8128612f15 Mon Sep 17 00:00:00 2001 From: robocanic Date: Sat, 13 Dec 2025 17:30:56 +0800 Subject: [PATCH 3/5] fix: unit test and license header --- nacos | 61 ------------------- pkg/core/discovery/component.go | 2 +- pkg/discovery/nacos2/factory.go | 19 +++++- .../nacos2/listerwatcher/nacos_service.go | 2 +- pkg/store/dbcommon/gorm_store_test.go | 43 +++++++++++++ 5 files changed, 63 insertions(+), 64 deletions(-) delete mode 100644 nacos diff --git a/nacos b/nacos deleted file mode 100644 index 6d0553ef7..000000000 --- a/nacos +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - Nacos - - - - - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - - - diff --git a/pkg/core/discovery/component.go b/pkg/core/discovery/component.go index 6efd7ff5a..9a1b5ddd0 100644 --- a/pkg/core/discovery/component.go +++ b/pkg/core/discovery/component.go @@ -113,7 +113,7 @@ func (d *discoveryComponent) Start(_ runtime.Runtime, ch <-chan struct{}) error err := d.subscriptionMgr.Subscribe(sub) if err != nil { return bizerror.Wrap(err, bizerror.EventError, - fmt.Sprintf("subscriber %s in discovery %s can not subscribe resource changed events", sub.Name())) + fmt.Sprintf("subscriber %s can not subscribe resource changed events", sub.Name())) } } for name, informers := range d.informers { diff --git a/pkg/discovery/nacos2/factory.go b/pkg/discovery/nacos2/factory.go index 8c0e402aa..3babaaf4d 100644 --- a/pkg/discovery/nacos2/factory.go +++ b/pkg/discovery/nacos2/factory.go @@ -1,4 +1,21 @@ -package dubbogo +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package nacos2 import ( "encoding/json" diff --git a/pkg/discovery/nacos2/listerwatcher/nacos_service.go b/pkg/discovery/nacos2/listerwatcher/nacos_service.go index bd5a842cd..1bb911efd 100644 --- a/pkg/discovery/nacos2/listerwatcher/nacos_service.go +++ b/pkg/discovery/nacos2/listerwatcher/nacos_service.go @@ -8,7 +8,7 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by servicelicable law or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and diff --git a/pkg/store/dbcommon/gorm_store_test.go b/pkg/store/dbcommon/gorm_store_test.go index 7d9d77fb1..e5f445d76 100644 --- a/pkg/store/dbcommon/gorm_store_test.go +++ b/pkg/store/dbcommon/gorm_store_test.go @@ -81,6 +81,35 @@ func (mr *mockResource) String() string { return string(b) } +type mockResourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []*mockResource `json:"items"` +} + +func (m mockResourceList) DeepCopyObject() runtime.Object { + out := &mockResourceList{ + TypeMeta: m.TypeMeta, + } + m.ListMeta.DeepCopyInto(&out.ListMeta) + + if len(m.Items) == 0 { + return out + } + out.Items = make([]*mockResource, len(m.Items)) + for i := range m.Items { + out.Items[i] = m.Items[i].DeepCopyObject().(*mockResource) + } + return out +} + +func (m mockResourceList) SetItems(items []model.Resource) { + m.Items = make([]*mockResource, len(items)) + for i := range items { + m.Items[i] = items[i].(*mockResource) + } +} + // setupTestStore creates a new GormStore with an in-memory SQLite database for testing func setupTestStore(t *testing.T) (*GormStore, func()) { // Create temporary SQLite database file for better isolation and reliability @@ -98,6 +127,13 @@ func setupTestStore(t *testing.T) (*GormStore, func()) { if _, err := model.ResourceSchemaRegistry().NewResourceFunc(kind); err != nil { model.RegisterResourceSchema(kind, func() model.Resource { return &mockResource{Kind: kind} + }, func() model.ResourceList { + return &mockResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: kind.ToString(), + }, + Items: []*mockResource{}, + } }) } @@ -1323,6 +1359,13 @@ func TestGormStore_ConcurrentOperations(t *testing.T) { kind := model.ResourceKind("TestResource") model.RegisterResourceSchema(kind, func() model.Resource { return &mockResource{Kind: kind} + }, func() model.ResourceList { + return &mockResourceList{ + TypeMeta: metav1.TypeMeta{ + Kind: kind.ToString(), + }, + Items: []*mockResource{}, + } }) store := NewGormStore(kind, "test-address", pool) From 7c4853ca928ee67ebc88de05947ac5d6615eae7e Mon Sep 17 00:00:00 2001 From: robocanic Date: Sat, 13 Dec 2025 18:22:34 +0800 Subject: [PATCH 4/5] fix: copilot review problem --- pkg/core/discovery/subscriber/rpc_instance.go | 2 +- pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go | 4 ++-- pkg/discovery/nacos2/listerwatcher/nacos_service.go | 4 ++-- pkg/store/dbcommon/gorm_store.go | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/core/discovery/subscriber/rpc_instance.go b/pkg/core/discovery/subscriber/rpc_instance.go index 952c37add..0a87f8c0d 100644 --- a/pkg/core/discovery/subscriber/rpc_instance.go +++ b/pkg/core/discovery/subscriber/rpc_instance.go @@ -180,7 +180,7 @@ func (s *RPCInstanceEventSubscriber) findRelatedRuntimeInstanceAndMerge(instance case enginecfg.Kubernetes: rtInstance := s.getRuntimeInstanceByIp(instanceRes.Spec.Ip) if rtInstance == nil { - logger.Warnf("cannot find runtime instance for isntace %s, skipping merging", instanceRes.ResourceKey()) + logger.Warnf("cannot find runtime instance for instace %s, skipping merging", instanceRes.ResourceKey()) return } meshresource.MergeRuntimeInstanceIntoInstance(rtInstance, instanceRes) diff --git a/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go b/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go index 7ed645298..7fa7f0e06 100644 --- a/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go +++ b/pkg/core/resource/apis/mesh/v1alpha1/instance_helper.go @@ -21,8 +21,8 @@ import ( "fmt" ) -func BuildInstanceResName(appName string, ip string, rpcProt int64) string { - return fmt.Sprintf("%s%s:%d", appName, ip, rpcProt) +func BuildInstanceResName(appName string, ip string, rpcPort int64) string { + return fmt.Sprintf("%s%s:%d", appName, ip, rpcPort) } // FromRPCInstance create an instance resource from a rpc instance resource diff --git a/pkg/discovery/nacos2/listerwatcher/nacos_service.go b/pkg/discovery/nacos2/listerwatcher/nacos_service.go index 1bb911efd..b7d718552 100644 --- a/pkg/discovery/nacos2/listerwatcher/nacos_service.go +++ b/pkg/discovery/nacos2/listerwatcher/nacos_service.go @@ -117,7 +117,7 @@ func (lw *NacosServiceListerWatcher) fetchAllServiceNames() ([]string, error) { return nil, err } serviceNameList = append(serviceNameList, serviceNames...) - if len(serviceNames) <= int(pageNum*pageSize) { + if len(serviceNames) < int(pageSize) { break } pageNum++ @@ -137,7 +137,7 @@ func (lw *NacosServiceListerWatcher) fetchAndProcessService() error { slice.ForEach(serviceNames, func(index int, item string) { lw.processNacosService(item) }) - if len(serviceNames) <= int(pageNum*pageSize) { + if len(serviceNames) < int(pageSize) { break } pageNum++ diff --git a/pkg/store/dbcommon/gorm_store.go b/pkg/store/dbcommon/gorm_store.go index ac237998b..3daed7cf8 100644 --- a/pkg/store/dbcommon/gorm_store.go +++ b/pkg/store/dbcommon/gorm_store.go @@ -18,6 +18,7 @@ package dbcommon import ( + "errors" "fmt" "reflect" "sort" @@ -277,7 +278,7 @@ func (gs *GormStore) GetByKey(key string) (item interface{}, exists bool, err er First(&m) if result.Error != nil { - if result.Error.Error() == "record not found" { + if errors.Is(result.Error, gorm.ErrRecordNotFound) { return nil, false, nil } return nil, false, result.Error From e358ad44220045c750b7e95d20ed25b2b2ff9d55 Mon Sep 17 00:00:00 2001 From: robocanic Date: Sat, 13 Dec 2025 19:30:16 +0800 Subject: [PATCH 5/5] chore: remove redundant code --- pkg/core/discovery/subscriber/nacos_service.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/core/discovery/subscriber/nacos_service.go b/pkg/core/discovery/subscriber/nacos_service.go index ca25e6829..f98de4eb9 100644 --- a/pkg/core/discovery/subscriber/nacos_service.go +++ b/pkg/core/discovery/subscriber/nacos_service.go @@ -227,10 +227,8 @@ func (n *NacosServiceEventSubscriber) processRPCInstanceUpsert(serviceRes *meshr res := meshresource.NewRPCInstanceResourceWithAttributes(resName, serviceRes.Mesh) var registerTime string timestamp, err := strconv.ParseInt(instance.Metadata[constants.TimestampKey], 10, 64) - if err != nil { - registerTime = "" - } else { - registerTime = time.UnixMilli(timestamp).Format("2006-01-02 15:04:05") + if err == nil { + registerTime = time.UnixMilli(timestamp).Format(constants.TimeFormatStr) } revision := instance.Metadata[constants.MetadataRevisionKey] metadataStorageType := instance.Metadata[constants.MetadataStorageTypeKey]