diff --git a/apis/grpc/v1/payload/payload_vtproto.pb.go b/apis/grpc/v1/payload/payload_vtproto.pb.go index 4eb23615ef..00488d7286 100644 --- a/apis/grpc/v1/payload/payload_vtproto.pb.go +++ b/apis/grpc/v1/payload/payload_vtproto.pb.go @@ -548,16 +548,13 @@ func (m *Search_StreamResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if vtmsg, ok := m.Payload.(interface { - MarshalToVT([]byte) (int, error) - SizeVT() int + MarshalToSizedBufferVT([]byte) (int, error) }); ok { - { - size := vtmsg.SizeVT() - i -= size - if _, err := vtmsg.MarshalToVT(dAtA[i:]); err != nil { - return 0, err - } + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size } return len(dAtA) - i, nil } @@ -589,10 +586,10 @@ func (m *Search_StreamResponse_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Search_StreamResponse_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if marshalto, ok := interface{}(m.Status).(interface { + if vtmsg, ok := interface{}(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { - size, err := marshalto.MarshalToSizedBufferVT(dAtA[:i]) + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -1968,16 +1965,13 @@ func (m *Object_StreamDistance) MarshalToSizedBufferVT(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if vtmsg, ok := m.Payload.(interface { - MarshalToVT([]byte) (int, error) - SizeVT() int + MarshalToSizedBufferVT([]byte) (int, error) }); ok { - { - size := vtmsg.SizeVT() - i -= size - if _, err := vtmsg.MarshalToVT(dAtA[i:]); err != nil { - return 0, err - } + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size } return len(dAtA) - i, nil } @@ -2009,10 +2003,10 @@ func (m *Object_StreamDistance_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Object_StreamDistance_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if marshalto, ok := interface{}(m.Status).(interface { + if vtmsg, ok := interface{}(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { - size, err := marshalto.MarshalToSizedBufferVT(dAtA[:i]) + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -2240,16 +2234,13 @@ func (m *Object_StreamVector) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if vtmsg, ok := m.Payload.(interface { - MarshalToVT([]byte) (int, error) - SizeVT() int + MarshalToSizedBufferVT([]byte) (int, error) }); ok { - { - size := vtmsg.SizeVT() - i -= size - if _, err := vtmsg.MarshalToVT(dAtA[i:]); err != nil { - return 0, err - } + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size } return len(dAtA) - i, nil } @@ -2281,10 +2272,10 @@ func (m *Object_StreamVector_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Object_StreamVector_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if marshalto, ok := interface{}(m.Status).(interface { + if vtmsg, ok := interface{}(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { - size, err := marshalto.MarshalToSizedBufferVT(dAtA[:i]) + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -2443,16 +2434,13 @@ func (m *Object_StreamBlob) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if vtmsg, ok := m.Payload.(interface { - MarshalToVT([]byte) (int, error) - SizeVT() int + MarshalToSizedBufferVT([]byte) (int, error) }); ok { - { - size := vtmsg.SizeVT() - i -= size - if _, err := vtmsg.MarshalToVT(dAtA[i:]); err != nil { - return 0, err - } + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size } return len(dAtA) - i, nil } @@ -2484,10 +2472,10 @@ func (m *Object_StreamBlob_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Object_StreamBlob_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if marshalto, ok := interface{}(m.Status).(interface { + if vtmsg, ok := interface{}(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { - size, err := marshalto.MarshalToSizedBufferVT(dAtA[:i]) + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -2594,16 +2582,13 @@ func (m *Object_StreamLocation) MarshalToSizedBufferVT(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if vtmsg, ok := m.Payload.(interface { - MarshalToVT([]byte) (int, error) - SizeVT() int + MarshalToSizedBufferVT([]byte) (int, error) }); ok { - { - size := vtmsg.SizeVT() - i -= size - if _, err := vtmsg.MarshalToVT(dAtA[i:]); err != nil { - return 0, err - } + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size } return len(dAtA) - i, nil } @@ -2635,10 +2620,10 @@ func (m *Object_StreamLocation_Status) MarshalToVT(dAtA []byte) (int, error) { func (m *Object_StreamLocation_Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) if m.Status != nil { - if marshalto, ok := interface{}(m.Status).(interface { + if vtmsg, ok := interface{}(m.Status).(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { - size, err := marshalto.MarshalToSizedBufferVT(dAtA[:i]) + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -3602,9 +3587,7 @@ func (m *Search_Request) SizeVT() (n int) { l = m.Config.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3620,9 +3603,7 @@ func (m *Search_MultiRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3640,9 +3621,7 @@ func (m *Search_IDRequest) SizeVT() (n int) { l = m.Config.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3658,9 +3637,7 @@ func (m *Search_MultiIDRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3682,9 +3659,7 @@ func (m *Search_ObjectRequest) SizeVT() (n int) { l = m.Vectorizer.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3700,9 +3675,7 @@ func (m *Search_MultiObjectRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3739,9 +3712,7 @@ func (m *Search_Config) SizeVT() (n int) { if m.MinNum != 0 { n += 1 + sov(uint64(m.MinNum)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3761,9 +3732,7 @@ func (m *Search_Response) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3779,9 +3748,7 @@ func (m *Search_Responses) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3794,9 +3761,7 @@ func (m *Search_StreamResponse) SizeVT() (n int) { if vtmsg, ok := m.Payload.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3836,9 +3801,7 @@ func (m *Search) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3855,9 +3818,7 @@ func (m *Filter_Target) SizeVT() (n int) { if m.Port != 0 { n += 1 + sov(uint64(m.Port)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3873,9 +3834,7 @@ func (m *Filter_Config) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3885,9 +3844,7 @@ func (m *Filter) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3905,9 +3862,7 @@ func (m *Insert_Request) SizeVT() (n int) { l = m.Config.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3923,9 +3878,7 @@ func (m *Insert_MultiRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3947,9 +3900,7 @@ func (m *Insert_ObjectRequest) SizeVT() (n int) { l = m.Vectorizer.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3965,9 +3916,7 @@ func (m *Insert_MultiObjectRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3987,9 +3936,7 @@ func (m *Insert_Config) SizeVT() (n int) { if m.Timestamp != 0 { n += 1 + sov(uint64(m.Timestamp)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -3999,9 +3946,7 @@ func (m *Insert) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4019,9 +3964,7 @@ func (m *Update_Request) SizeVT() (n int) { l = m.Config.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4037,9 +3980,7 @@ func (m *Update_MultiRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4061,9 +4002,7 @@ func (m *Update_ObjectRequest) SizeVT() (n int) { l = m.Vectorizer.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4079,9 +4018,7 @@ func (m *Update_MultiObjectRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4101,9 +4038,7 @@ func (m *Update_Config) SizeVT() (n int) { if m.Timestamp != 0 { n += 1 + sov(uint64(m.Timestamp)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4113,9 +4048,7 @@ func (m *Update) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4133,9 +4066,7 @@ func (m *Upsert_Request) SizeVT() (n int) { l = m.Config.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4151,9 +4082,7 @@ func (m *Upsert_MultiRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4175,9 +4104,7 @@ func (m *Upsert_ObjectRequest) SizeVT() (n int) { l = m.Vectorizer.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4193,9 +4120,7 @@ func (m *Upsert_MultiObjectRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4215,9 +4140,7 @@ func (m *Upsert_Config) SizeVT() (n int) { if m.Timestamp != 0 { n += 1 + sov(uint64(m.Timestamp)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4227,9 +4150,7 @@ func (m *Upsert) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4247,9 +4168,7 @@ func (m *Remove_Request) SizeVT() (n int) { l = m.Config.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4265,9 +4184,7 @@ func (m *Remove_MultiRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4283,9 +4200,7 @@ func (m *Remove_Config) SizeVT() (n int) { if m.Timestamp != 0 { n += 1 + sov(uint64(m.Timestamp)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4295,9 +4210,7 @@ func (m *Remove) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4315,9 +4228,7 @@ func (m *Object_VectorRequest) SizeVT() (n int) { l = m.Filters.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4334,9 +4245,7 @@ func (m *Object_Distance) SizeVT() (n int) { if m.Distance != 0 { n += 5 } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4349,9 +4258,7 @@ func (m *Object_StreamDistance) SizeVT() (n int) { if vtmsg, ok := m.Payload.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4395,9 +4302,7 @@ func (m *Object_ID) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4413,9 +4318,7 @@ func (m *Object_IDs) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4432,9 +4335,7 @@ func (m *Object_Vector) SizeVT() (n int) { if len(m.Vector) > 0 { n += 1 + sov(uint64(len(m.Vector)*4)) + len(m.Vector)*4 } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4450,9 +4351,7 @@ func (m *Object_Vectors) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4465,9 +4364,7 @@ func (m *Object_StreamVector) SizeVT() (n int) { if vtmsg, ok := m.Payload.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4518,9 +4415,7 @@ func (m *Object_ReshapeVector) SizeVT() (n int) { } n += 1 + sov(uint64(l)) + l } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4538,9 +4433,7 @@ func (m *Object_Blob) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4553,9 +4446,7 @@ func (m *Object_StreamBlob) SizeVT() (n int) { if vtmsg, ok := m.Payload.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4609,9 +4500,7 @@ func (m *Object_Location) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4624,9 +4513,7 @@ func (m *Object_StreamLocation) SizeVT() (n int) { if vtmsg, ok := m.Payload.(interface{ SizeVT() int }); ok { n += vtmsg.SizeVT() } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4672,9 +4559,7 @@ func (m *Object_Locations) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4684,9 +4569,7 @@ func (m *Object) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4699,9 +4582,7 @@ func (m *Control_CreateIndexRequest) SizeVT() (n int) { if m.PoolSize != 0 { n += 1 + sov(uint64(m.PoolSize)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4711,9 +4592,7 @@ func (m *Control) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4735,9 +4614,7 @@ func (m *Discoverer_Request) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4747,9 +4624,7 @@ func (m *Discoverer) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4771,9 +4646,7 @@ func (m *Info_Index_Count) SizeVT() (n int) { if m.Saving { n += 2 } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4787,9 +4660,7 @@ func (m *Info_Index_UUID_Committed) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4803,9 +4674,7 @@ func (m *Info_Index_UUID_Uncommitted) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4815,9 +4684,7 @@ func (m *Info_Index_UUID) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4827,9 +4694,7 @@ func (m *Info_Index) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4867,9 +4732,7 @@ func (m *Info_Pod) SizeVT() (n int) { l = m.Node.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4903,9 +4766,7 @@ func (m *Info_Node) SizeVT() (n int) { l = m.Pods.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4924,9 +4785,7 @@ func (m *Info_CPU) SizeVT() (n int) { if m.Usage != 0 { n += 9 } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4945,9 +4804,7 @@ func (m *Info_Memory) SizeVT() (n int) { if m.Usage != 0 { n += 9 } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4963,9 +4820,7 @@ func (m *Info_Pods) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4981,9 +4836,7 @@ func (m *Info_Nodes) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -4999,9 +4852,7 @@ func (m *Info_IPs) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -5011,9 +4862,7 @@ func (m *Info) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -5023,9 +4872,7 @@ func (m *Empty) SizeVT() (n int) { } var l int _ = l - if m.unknownFields != nil { - n += len(m.unknownFields) - } + n += len(m.unknownFields) return n } @@ -6210,7 +6057,7 @@ func (m *Search_StreamResponse) UnmarshalVT(dAtA []byte) error { if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Payload = &Search_StreamResponse_Response{v} + m.Payload = &Search_StreamResponse_Response{Response: v} } iNdEx = postIndex case 2: @@ -6267,7 +6114,7 @@ func (m *Search_StreamResponse) UnmarshalVT(dAtA []byte) error { return err } } - m.Payload = &Search_StreamResponse_Status{v} + m.Payload = &Search_StreamResponse_Status{Status: v} } iNdEx = postIndex default: @@ -9101,7 +8948,7 @@ func (m *Object_StreamDistance) UnmarshalVT(dAtA []byte) error { if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Payload = &Object_StreamDistance_Distance{v} + m.Payload = &Object_StreamDistance_Distance{Distance: v} } iNdEx = postIndex case 2: @@ -9158,7 +9005,7 @@ func (m *Object_StreamDistance) UnmarshalVT(dAtA []byte) error { return err } } - m.Payload = &Object_StreamDistance_Status{v} + m.Payload = &Object_StreamDistance_Status{Status: v} } iNdEx = postIndex default: @@ -9638,7 +9485,7 @@ func (m *Object_StreamVector) UnmarshalVT(dAtA []byte) error { if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Payload = &Object_StreamVector_Vector{v} + m.Payload = &Object_StreamVector_Vector{Vector: v} } iNdEx = postIndex case 2: @@ -9695,7 +9542,7 @@ func (m *Object_StreamVector) UnmarshalVT(dAtA []byte) error { return err } } - m.Payload = &Object_StreamVector_Status{v} + m.Payload = &Object_StreamVector_Status{Status: v} } iNdEx = postIndex default: @@ -10065,7 +9912,7 @@ func (m *Object_StreamBlob) UnmarshalVT(dAtA []byte) error { if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Payload = &Object_StreamBlob_Blob{v} + m.Payload = &Object_StreamBlob_Blob{Blob: v} } iNdEx = postIndex case 2: @@ -10122,7 +9969,7 @@ func (m *Object_StreamBlob) UnmarshalVT(dAtA []byte) error { return err } } - m.Payload = &Object_StreamBlob_Status{v} + m.Payload = &Object_StreamBlob_Status{Status: v} } iNdEx = postIndex default: @@ -10361,7 +10208,7 @@ func (m *Object_StreamLocation) UnmarshalVT(dAtA []byte) error { if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Payload = &Object_StreamLocation_Location{v} + m.Payload = &Object_StreamLocation_Location{Location: v} } iNdEx = postIndex case 2: @@ -10418,7 +10265,7 @@ func (m *Object_StreamLocation) UnmarshalVT(dAtA []byte) error { return err } } - m.Payload = &Object_StreamLocation_Status{v} + m.Payload = &Object_StreamLocation_Status{Status: v} } iNdEx = postIndex default: @@ -12360,6 +12207,7 @@ func (m *Empty) UnmarshalVT(dAtA []byte) error { } return nil } + func skip(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/example/client/go.mod b/example/client/go.mod index 9950b7f0b5..01ba8339a8 100644 --- a/example/client/go.mod +++ b/example/client/go.mod @@ -11,8 +11,8 @@ replace ( golang.org/x/crypto => golang.org/x/crypto v0.5.0 golang.org/x/net => golang.org/x/net v0.5.0 golang.org/x/text => golang.org/x/text v0.6.0 - google.golang.org/genproto => google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 - google.golang.org/grpc => google.golang.org/grpc v1.52.0 + google.golang.org/genproto => google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 + google.golang.org/grpc => google.golang.org/grpc v1.52.3 google.golang.org/protobuf => google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1 diff --git a/example/client/go.sum b/example/client/go.sum index fb13dcaf99..30da9e9cfa 100644 --- a/example/client/go.sum +++ b/example/client/go.sum @@ -27,9 +27,9 @@ golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENEmZU3BkO4e+fod7nKzgM= gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I= -google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 h1:BwjeHhu4HS48EZmu1nS7flldBIDPC3qn+HqaSQ1K4x8= -google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= -google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 h1:vArvWooPH749rNHpBGgVl+U9B9dATjiEhJzcWGlovNs= +google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ= +google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/go.mod b/go.mod index 1bee423710..7c1d5be8c5 100755 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 replace ( cloud.google.com/go => cloud.google.com/go v0.109.0 cloud.google.com/go/bigquery => cloud.google.com/go/bigquery v1.45.0 - cloud.google.com/go/compute => cloud.google.com/go/compute v1.15.1 + cloud.google.com/go/compute => cloud.google.com/go/compute v1.18.0 cloud.google.com/go/datastore => cloud.google.com/go/datastore v1.10.0 cloud.google.com/go/firestore => cloud.google.com/go/firestore v1.9.0 cloud.google.com/go/iam => cloud.google.com/go/iam v0.10.0 @@ -14,7 +14,7 @@ replace ( cloud.google.com/go/pubsub => cloud.google.com/go/pubsub v1.28.0 cloud.google.com/go/secretmanager => cloud.google.com/go/secretmanager v1.10.0 cloud.google.com/go/storage => cloud.google.com/go/storage v1.29.0 - cloud.google.com/go/trace => cloud.google.com/go/trace v1.5.0 + cloud.google.com/go/trace => cloud.google.com/go/trace v1.8.0 code.cloudfoundry.org/bytefmt => code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5 contrib.go.opencensus.io/exporter/aws => contrib.go.opencensus.io/exporter/aws v0.0.0-20200617204711-c478e41e60e9 contrib.go.opencensus.io/exporter/prometheus => contrib.go.opencensus.io/exporter/prometheus v0.4.2 @@ -23,13 +23,13 @@ replace ( github.com/AdaLogics/go-fuzz-headers => github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 github.com/Azure/azure-amqp-common-go/v3 => github.com/Azure/azure-amqp-common-go/v3 v3.2.3 github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v68.0.0+incompatible - github.com/Azure/azure-sdk-for-go/sdk/azcore => github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity => github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore => github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.1 + github.com/Azure/azure-sdk-for-go/sdk/azidentity => github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1 github.com/Azure/azure-sdk-for-go/sdk/internal => github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 github.com/Azure/azure-service-bus-go => github.com/Azure/azure-service-bus-go v0.11.5 github.com/Azure/azure-storage-blob-go => github.com/Azure/azure-storage-blob-go v0.15.0 github.com/Azure/go-amqp => github.com/Azure/go-amqp v0.18.1 - github.com/Azure/go-ansiterm => github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 + github.com/Azure/go-ansiterm => github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.1-0.20230117190326-9038e4a609b1+incompatible github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.11.29-0.20230117190326-9038e4a609b1 github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.9.22 @@ -52,36 +52,34 @@ replace ( github.com/ajstarks/deck => github.com/ajstarks/deck v0.0.0-20221111133444-1e8e70fde520 github.com/ajstarks/deck/generate => github.com/ajstarks/deck/generate v0.0.0-20221111133444-1e8e70fde520 github.com/ajstarks/svgo => github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b - github.com/alecthomas/units => github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 - github.com/alexflint/go-filemutex => github.com/alexflint/go-filemutex v1.2.0 github.com/antihax/optional => github.com/antihax/optional v1.0.0 github.com/armon/circbuf => github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 github.com/armon/go-metrics => github.com/armon/go-metrics v0.4.1 github.com/armon/go-radix => github.com/armon/go-radix v1.0.0 github.com/armon/go-socks5 => github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/asaskevich/govalidator => github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d - github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.44.185 - github.com/aws/aws-sdk-go-v2 => github.com/aws/aws-sdk-go-v2 v1.17.3 + github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.44.195 + github.com/aws/aws-sdk-go-v2 => github.com/aws/aws-sdk-go-v2 v1.17.4 github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream => github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 - github.com/aws/aws-sdk-go-v2/config => github.com/aws/aws-sdk-go-v2/config v1.18.9 - github.com/aws/aws-sdk-go-v2/credentials => github.com/aws/aws-sdk-go-v2/credentials v1.13.9 - github.com/aws/aws-sdk-go-v2/feature/ec2/imds => github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 - github.com/aws/aws-sdk-go-v2/feature/s3/manager => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.48 - github.com/aws/aws-sdk-go-v2/internal/configsources => github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 - github.com/aws/aws-sdk-go-v2/internal/ini => github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 + github.com/aws/aws-sdk-go-v2/config => github.com/aws/aws-sdk-go-v2/config v1.18.12 + github.com/aws/aws-sdk-go-v2/credentials => github.com/aws/aws-sdk-go-v2/credentials v1.13.12 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds => github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22 + github.com/aws/aws-sdk-go-v2/feature/s3/manager => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.51 + github.com/aws/aws-sdk-go-v2/internal/configsources => github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22 + github.com/aws/aws-sdk-go-v2/internal/ini => github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding => github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 - github.com/aws/aws-sdk-go-v2/service/internal/checksum => github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.22 - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url => github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 - github.com/aws/aws-sdk-go-v2/service/internal/s3shared => github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.21 - github.com/aws/aws-sdk-go-v2/service/kms => github.com/aws/aws-sdk-go-v2/service/kms v1.20.1 - github.com/aws/aws-sdk-go-v2/service/s3 => github.com/aws/aws-sdk-go-v2/service/s3 v1.30.1 - github.com/aws/aws-sdk-go-v2/service/secretsmanager => github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.18.2 - github.com/aws/aws-sdk-go-v2/service/sns => github.com/aws/aws-sdk-go-v2/service/sns v1.19.1 - github.com/aws/aws-sdk-go-v2/service/sqs => github.com/aws/aws-sdk-go-v2/service/sqs v1.20.1 - github.com/aws/aws-sdk-go-v2/service/ssm => github.com/aws/aws-sdk-go-v2/service/ssm v1.35.1 - github.com/aws/aws-sdk-go-v2/service/sso => github.com/aws/aws-sdk-go-v2/service/sso v1.12.0 - github.com/aws/aws-sdk-go-v2/service/sts => github.com/aws/aws-sdk-go-v2/service/sts v1.18.1 + github.com/aws/aws-sdk-go-v2/service/internal/checksum => github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.23 + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url => github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22 + github.com/aws/aws-sdk-go-v2/service/internal/s3shared => github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.22 + github.com/aws/aws-sdk-go-v2/service/kms => github.com/aws/aws-sdk-go-v2/service/kms v1.20.2 + github.com/aws/aws-sdk-go-v2/service/s3 => github.com/aws/aws-sdk-go-v2/service/s3 v1.30.2 + github.com/aws/aws-sdk-go-v2/service/secretsmanager => github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.18.3 + github.com/aws/aws-sdk-go-v2/service/sns => github.com/aws/aws-sdk-go-v2/service/sns v1.20.1 + github.com/aws/aws-sdk-go-v2/service/sqs => github.com/aws/aws-sdk-go-v2/service/sqs v1.20.2 + github.com/aws/aws-sdk-go-v2/service/ssm => github.com/aws/aws-sdk-go-v2/service/ssm v1.35.2 + github.com/aws/aws-sdk-go-v2/service/sso => github.com/aws/aws-sdk-go-v2/service/sso v1.12.1 + github.com/aws/aws-sdk-go-v2/service/sts => github.com/aws/aws-sdk-go-v2/service/sts v1.18.3 github.com/aws/smithy-go => github.com/aws/smithy-go v1.13.5 github.com/benbjohnson/clock => github.com/benbjohnson/clock v1.3.0 github.com/beorn7/perks => github.com/beorn7/perks v1.0.1 @@ -100,24 +98,22 @@ replace ( github.com/chzyer/logex => github.com/chzyer/logex v1.2.1 github.com/chzyer/readline => github.com/chzyer/readline v1.5.1 github.com/chzyer/test => github.com/chzyer/test v1.0.0 - github.com/cilium/ebpf => github.com/cilium/ebpf v0.10.0 - github.com/circonus-labs/circonus-gometrics => github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible github.com/cncf/udpa/go => github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe github.com/cncf/xds/go => github.com/cncf/xds/go v0.0.0-20230112175826-46e39c7b9b43 github.com/cockroachdb/apd => github.com/cockroachdb/apd v1.1.0 github.com/cockroachdb/datadriven => github.com/cockroachdb/datadriven v1.0.2 github.com/containerd/aufs => github.com/containerd/aufs v1.0.0 github.com/containerd/btrfs => github.com/containerd/btrfs v1.0.0 - github.com/containerd/cgroups => github.com/containerd/cgroups v1.0.4 + github.com/containerd/cgroups => github.com/containerd/cgroups v1.1.0 github.com/containerd/console => github.com/containerd/console v1.0.3 - github.com/containerd/containerd => github.com/containerd/containerd v1.6.15 + github.com/containerd/containerd => github.com/containerd/containerd v1.6.16 github.com/containerd/continuity => github.com/containerd/continuity v0.3.0 github.com/containerd/fifo => github.com/containerd/fifo v1.0.0 github.com/containerd/go-cni => github.com/containerd/go-cni v1.1.7 github.com/containerd/go-runc => github.com/containerd/go-runc v1.0.0 github.com/containerd/imgcrypt => github.com/containerd/imgcrypt v1.1.7 github.com/containerd/nri => github.com/containerd/nri v0.2.0 - github.com/containerd/stargz-snapshotter/estargz => github.com/containerd/stargz-snapshotter/estargz v0.13.0 + github.com/containerd/stargz-snapshotter/estargz => github.com/containerd/stargz-snapshotter/estargz v0.14.1 github.com/containerd/ttrpc => github.com/containerd/ttrpc v1.1.0 github.com/containerd/typeurl => github.com/containerd/typeurl v1.0.2 github.com/containerd/zfs => github.com/containerd/zfs v1.0.0 @@ -139,13 +135,10 @@ replace ( github.com/dennwc/varint => github.com/dennwc/varint v1.0.0 github.com/devigned/tab => github.com/devigned/tab v0.1.1 github.com/dgryski/go-rendezvous => github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f - github.com/dgryski/go-sip13 => github.com/dgryski/go-sip13 v0.0.0-20200911182023-62edffca9245 - github.com/digitalocean/godo => github.com/digitalocean/godo v1.94.0 - github.com/dimchansky/utfbom => github.com/dimchansky/utfbom v1.1.1 github.com/dnaeon/go-vcr => github.com/dnaeon/go-vcr v1.2.0 - github.com/docker/cli => github.com/docker/cli v20.10.23+incompatible + github.com/docker/cli => github.com/docker/cli v23.0.0+incompatible github.com/docker/distribution => github.com/docker/distribution v2.8.1+incompatible - github.com/docker/docker => github.com/docker/docker v20.10.23+incompatible + github.com/docker/docker => github.com/docker/docker v23.0.0+incompatible github.com/docker/docker-credential-helpers => github.com/docker/docker-credential-helpers v0.7.0 github.com/docker/go-connections => github.com/docker/go-connections v0.4.0 github.com/docker/go-events => github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c @@ -153,22 +146,18 @@ replace ( github.com/docker/go-units => github.com/docker/go-units v0.5.0 github.com/docopt/docopt-go => github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 github.com/dustin/go-humanize => github.com/dustin/go-humanize v1.0.1 - github.com/dvyukov/go-fuzz => github.com/dvyukov/go-fuzz v0.0.0-20220726122315-1d375ef9f9f6 github.com/edsrzf/mmap-go => github.com/edsrzf/mmap-go v1.1.0 github.com/elazarl/goproxy => github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 github.com/emicklei/go-restful => github.com/emicklei/go-restful v2.16.0+incompatible github.com/emicklei/go-restful/v3 => github.com/emicklei/go-restful/v3 v3.10.1 - github.com/envoyproxy/go-control-plane => github.com/envoyproxy/go-control-plane v0.10.3 + github.com/envoyproxy/go-control-plane => github.com/envoyproxy/go-control-plane v0.11.0 github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate v0.9.1 github.com/evanphx/json-patch => github.com/evanphx/json-patch v0.5.2 - github.com/fatih/color => github.com/fatih/color v1.14.1 - github.com/felixge/httpsnoop => github.com/felixge/httpsnoop v1.0.3 github.com/fogleman/gg => github.com/fogleman/gg v1.3.0 github.com/form3tech-oss/jwt-go => github.com/form3tech-oss/jwt-go v3.2.5+incompatible github.com/fortytw2/leaktest => github.com/fortytw2/leaktest v1.3.0 github.com/frankban/quicktest => github.com/frankban/quicktest v1.14.4 github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.6.0 - github.com/ghodss/yaml => github.com/ghodss/yaml v1.0.0 github.com/gin-contrib/sse => github.com/gin-contrib/sse v0.1.0 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.2 github.com/go-errors/errors => github.com/go-errors/errors v1.4.2 @@ -181,12 +170,10 @@ replace ( github.com/go-kit/kit => github.com/go-kit/kit v0.12.1-0.20230102061018-e923d5df8514 github.com/go-kit/log => github.com/go-kit/log v0.2.1 github.com/go-latex/latex => github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 - github.com/go-logfmt/logfmt => github.com/go-logfmt/logfmt v0.5.1 + github.com/go-logfmt/logfmt => github.com/go-logfmt/logfmt v0.6.0 github.com/go-logr/logr => github.com/go-logr/logr v1.2.3 github.com/go-logr/stdr => github.com/go-logr/stdr v1.2.2 github.com/go-logr/zapr => github.com/go-logr/zapr v1.2.3 - github.com/go-openapi/analysis => github.com/go-openapi/analysis v0.21.4 - github.com/go-openapi/errors => github.com/go-openapi/errors v0.20.3 github.com/go-openapi/jsonpointer => github.com/go-openapi/jsonpointer v0.19.6 github.com/go-openapi/jsonreference => github.com/go-openapi/jsonreference v0.20.2 github.com/go-openapi/loads => github.com/go-openapi/loads v0.21.2 @@ -198,16 +185,16 @@ replace ( github.com/go-pdf/fpdf => github.com/go-pdf/fpdf v1.4.3 github.com/go-playground/assert/v2 => github.com/go-playground/assert/v2 v2.2.0 github.com/go-playground/locales => github.com/go-playground/locales v0.14.1 - github.com/go-playground/universal-translator => github.com/go-playground/universal-translator v0.18.0 - github.com/go-playground/validator/v10 => github.com/go-playground/validator/v10 v10.11.1 + github.com/go-playground/universal-translator => github.com/go-playground/universal-translator v0.18.1 + github.com/go-playground/validator/v10 => github.com/go-playground/validator/v10 v10.11.2 github.com/go-redis/redis/v8 => github.com/go-redis/redis/v8 v8.11.5 github.com/go-resty/resty/v2 => github.com/go-resty/resty/v2 v2.7.0 github.com/go-sql-driver/mysql => github.com/go-sql-driver/mysql v1.7.0 github.com/go-stack/stack => github.com/go-stack/stack v1.8.1 github.com/go-task/slim-sprig => github.com/go-task/slim-sprig v2.20.0+incompatible - github.com/go-toolsmith/astcopy => github.com/go-toolsmith/astcopy v1.0.2 - github.com/go-toolsmith/astequal => github.com/go-toolsmith/astequal v1.0.3 - github.com/go-toolsmith/strparse => github.com/go-toolsmith/strparse v1.0.0 + github.com/go-toolsmith/astcopy => github.com/go-toolsmith/astcopy v1.1.0 + github.com/go-toolsmith/astequal => github.com/go-toolsmith/astequal v1.1.0 + github.com/go-toolsmith/strparse => github.com/go-toolsmith/strparse v1.1.0 github.com/go-zookeeper/zk => github.com/go-zookeeper/zk v1.0.3 github.com/gobwas/httphead => github.com/gobwas/httphead v0.1.0 github.com/gobwas/pool => github.com/gobwas/pool v0.2.1 @@ -217,7 +204,7 @@ replace ( github.com/gocql/gocql => github.com/gocql/gocql v1.3.1 github.com/gocraft/dbr/v2 => github.com/gocraft/dbr/v2 v2.7.3 github.com/godbus/dbus/v5 => github.com/godbus/dbus/v5 v5.1.0 - github.com/gofrs/uuid => github.com/gofrs/uuid v4.3.1+incompatible + github.com/gofrs/uuid => github.com/gofrs/uuid v4.4.0+incompatible github.com/gogo/googleapis => github.com/gogo/googleapis v1.4.1 github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 github.com/golang-jwt/jwt/v4 => github.com/golang-jwt/jwt/v4 v4.4.3 @@ -232,23 +219,19 @@ replace ( github.com/google/btree => github.com/google/btree v1.1.2 github.com/google/gnostic => github.com/google/gnostic v0.6.9 github.com/google/go-cmp => github.com/google/go-cmp v0.5.9 - github.com/google/go-containerregistry => github.com/google/go-containerregistry v0.12.1 + github.com/google/go-containerregistry => github.com/google/go-containerregistry v0.13.0 github.com/google/go-querystring => github.com/google/go-querystring v1.1.0 github.com/google/go-replayers/grpcreplay => github.com/google/go-replayers/grpcreplay v1.1.0 github.com/google/go-replayers/httpreplay => github.com/google/go-replayers/httpreplay v1.1.1 github.com/google/gofuzz => github.com/google/gofuzz v1.2.0 github.com/google/martian => github.com/google/martian v2.1.0+incompatible github.com/google/martian/v3 => github.com/google/martian/v3 v3.3.2 - github.com/google/pprof => github.com/google/pprof v0.0.0-20230111200839-76d1ae5aea2b + github.com/google/pprof => github.com/google/pprof v0.0.0-20230131232505-5a9e8f65f08f github.com/google/shlex => github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/subcommands => github.com/google/subcommands v1.2.0 github.com/google/uuid => github.com/google/uuid v1.3.0 github.com/google/wire => github.com/google/wire v0.5.0 github.com/googleapis/gax-go/v2 => github.com/googleapis/gax-go/v2 v2.7.0 - github.com/googleapis/go-type-adapters => github.com/googleapis/go-type-adapters v1.0.0 - github.com/gophercloud/gophercloud => github.com/gophercloud/gophercloud v1.1.1 - github.com/gopherjs/gopherjs => github.com/gopherjs/gopherjs v1.17.2 - github.com/gorilla/context => github.com/gorilla/context v1.1.1 github.com/gorilla/mux => github.com/gorilla/mux v1.8.0 github.com/gorilla/websocket => github.com/gorilla/websocket v1.5.0 github.com/grafana/regexp => github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd @@ -299,8 +282,7 @@ replace ( github.com/jmespath/go-jmespath => github.com/jmespath/go-jmespath v0.4.0 github.com/jmespath/go-jmespath/internal/testify => github.com/jmespath/go-jmespath/internal/testify v1.5.1 github.com/jmoiron/sqlx => github.com/jmoiron/sqlx v1.3.5 - github.com/joho/godotenv => github.com/joho/godotenv v1.4.0 - github.com/jonboulle/clockwork => github.com/jonboulle/clockwork v0.3.0 + github.com/joho/godotenv => github.com/joho/godotenv v1.5.1 github.com/josharian/intern => github.com/josharian/intern v1.0.0 github.com/json-iterator/go => github.com/json-iterator/go v1.1.12 github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report v1.0.0 @@ -308,7 +290,7 @@ replace ( github.com/julienschmidt/httprouter => github.com/julienschmidt/httprouter v1.3.0 github.com/kisielk/errcheck => github.com/kisielk/errcheck v1.6.3 github.com/kisielk/gotool => github.com/kisielk/gotool v1.0.0 - github.com/klauspost/compress => github.com/klauspost/compress v1.15.16-0.20230121171712-fe37dc6783c8 + github.com/klauspost/compress => github.com/klauspost/compress v1.15.16-0.20230205172721-c847bdeec5da github.com/klauspost/cpuid/v2 => github.com/klauspost/cpuid/v2 v2.2.3 github.com/kolo/xmlrpc => github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b github.com/kpango/fastime => github.com/kpango/fastime v1.1.6 @@ -323,7 +305,7 @@ replace ( github.com/leodido/go-urn => github.com/leodido/go-urn v1.2.1 github.com/lib/pq => github.com/lib/pq v1.10.7 github.com/liggitt/tabwriter => github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de - github.com/linode/linodego => github.com/linode/linodego v1.12.0 + github.com/linode/linodego => github.com/linode/linodego v1.13.0 github.com/linuxkit/virtsock => github.com/linuxkit/virtsock v0.0.0-20220523201153-1a23e78aa7a2 github.com/lucasb-eyer/go-colorful => github.com/lucasb-eyer/go-colorful v1.2.0 github.com/lyft/protoc-gen-star => github.com/lyft/protoc-gen-star v0.6.2 @@ -333,10 +315,6 @@ replace ( github.com/mattn/go-shellwords => github.com/mattn/go-shellwords v1.0.12 github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.14.16 github.com/matttproud/golang_protobuf_extensions => github.com/matttproud/golang_protobuf_extensions v1.0.4 - github.com/miekg/dns => github.com/miekg/dns v1.1.50 - github.com/miekg/pkcs11 => github.com/miekg/pkcs11 v1.1.1 - github.com/mistifyio/go-zfs => github.com/mistifyio/go-zfs v2.1.1+incompatible - github.com/mitchellh/cli => github.com/mitchellh/cli v1.1.5 github.com/mitchellh/colorstring => github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db github.com/mitchellh/go-homedir => github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-wordwrap => github.com/mitchellh/go-wordwrap v1.0.1 @@ -355,22 +333,12 @@ replace ( github.com/morikuni/aec => github.com/morikuni/aec v1.0.0 github.com/mrunalp/fileutils => github.com/mrunalp/fileutils v0.5.0 github.com/munnerz/goautoneg => github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 - github.com/mwitkow/go-conntrack => github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f - github.com/mxk/go-flowrate => github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f github.com/niemeyer/pretty => github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e github.com/nxadm/tail => github.com/nxadm/tail v1.4.8 github.com/oklog/run => github.com/oklog/run v1.1.0 github.com/oklog/ulid => github.com/oklog/ulid v1.3.1 github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega => github.com/onsi/gomega v1.26.0 - github.com/opencontainers/go-digest => github.com/opencontainers/go-digest v1.0.0 - github.com/opencontainers/image-spec => github.com/opencontainers/image-spec v1.0.2 - github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.4 - github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec v1.0.2 - github.com/opencontainers/selinux => github.com/opencontainers/selinux v1.10.2 - github.com/opentracing/opentracing-go => github.com/opentracing/opentracing-go v1.2.0 - github.com/pascaldekloe/goe => github.com/pascaldekloe/goe v0.1.0 - github.com/pelletier/go-toml => github.com/pelletier/go-toml v1.9.5 github.com/peterbourgon/diskv => github.com/peterbourgon/diskv v2.0.1+incompatible github.com/phpdave11/gofpdf => github.com/phpdave11/gofpdf v1.4.2 github.com/phpdave11/gofpdi => github.com/phpdave11/gofpdi v1.0.13 @@ -401,7 +369,7 @@ replace ( github.com/rogpeppe/go-internal => github.com/rogpeppe/go-internal v1.9.0 github.com/rs/cors => github.com/rs/cors v1.8.3 github.com/rs/xid => github.com/rs/xid v1.4.0 - github.com/rs/zerolog => github.com/rs/zerolog v1.28.0 + github.com/rs/zerolog => github.com/rs/zerolog v1.29.0 github.com/russross/blackfriday/v2 => github.com/russross/blackfriday/v2 v2.1.0 github.com/ruudk/golang-pdf417 => github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245 github.com/ryanuber/columnize => github.com/ryanuber/columnize v2.1.2+incompatible @@ -426,18 +394,10 @@ replace ( github.com/spf13/cast => github.com/spf13/cast v1.5.0 github.com/spf13/cobra => github.com/spf13/cobra v1.6.1 github.com/spf13/pflag => github.com/spf13/pflag v1.0.5 - github.com/stefanberger/go-pkcs11uri => github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980 github.com/stoewer/go-strcase => github.com/stoewer/go-strcase v1.2.1 github.com/stretchr/objx => github.com/stretchr/objx v0.5.0 github.com/stretchr/testify => github.com/stretchr/testify v1.8.1 - github.com/syndtr/gocapability => github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 - github.com/tchap/go-patricia => github.com/tchap/go-patricia v2.3.0+incompatible - github.com/tidwall/pretty => github.com/tidwall/pretty v1.2.1 - github.com/tmc/grpc-websocket-proxy => github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 - github.com/tv42/httpunix => github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c - github.com/ugorji/go => github.com/ugorji/go v1.2.8 - github.com/ugorji/go/codec => github.com/ugorji/go/codec v1.2.8 - github.com/urfave/cli => github.com/urfave/cli v1.22.12 + github.com/ugorji/go/codec => github.com/ugorji/go/codec v1.2.9 github.com/vdaas/vald-client-go => github.com/vdaas/vald-client-go v1.7.0 github.com/vishvananda/netlink => github.com/vishvananda/netlink v1.1.0 github.com/vishvananda/netns => github.com/vishvananda/netns v0.0.4 @@ -449,11 +409,9 @@ replace ( github.com/xeipuuv/gojsonschema => github.com/xeipuuv/gojsonschema v1.2.0 github.com/xiang90/probing => github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 github.com/xlab/treeprint => github.com/xlab/treeprint v1.1.0 - github.com/youmark/pkcs8 => github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a - github.com/yuin/goldmark => github.com/yuin/goldmark v1.5.3 github.com/zeebo/assert => github.com/zeebo/assert v1.3.1 github.com/zeebo/xxh3 => github.com/zeebo/xxh3 v1.0.2 - go.etcd.io/bbolt => go.etcd.io/bbolt v1.3.6 + go.etcd.io/bbolt => go.etcd.io/bbolt v1.3.7 go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.5.7 go.etcd.io/etcd/client/pkg/v3 => go.etcd.io/etcd/client/pkg/v3 v3.5.7 go.etcd.io/etcd/client/v2 => go.etcd.io/etcd/client/v2 v2.305.7 @@ -476,18 +434,16 @@ replace ( go.opentelemetry.io/otel/sdk/metric => go.opentelemetry.io/otel/sdk/metric v0.33.0 go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.11.1 go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v0.19.0 - go.starlark.net => go.starlark.net v0.0.0-20230122040757-066229b0515d + go.starlark.net => go.starlark.net v0.0.0-20230128213706-3f75dec8e403 go.uber.org/atomic => go.uber.org/atomic v1.10.0 go.uber.org/automaxprocs => go.uber.org/automaxprocs v1.5.1 go.uber.org/goleak => go.uber.org/goleak v1.2.0 go.uber.org/multierr => go.uber.org/multierr v1.9.0 go.uber.org/zap => go.uber.org/zap v1.24.0 - go4.org/intern => go4.org/intern v0.0.0-20220617035311-6925f38cc365 - go4.org/unsafe/assume-no-moving-gc => go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 gocloud.dev => gocloud.dev v0.28.0 golang.org/x/crypto => golang.org/x/crypto v0.5.0 - golang.org/x/exp => golang.org/x/exp v0.0.0-20230118134722-a68e582fa157 - golang.org/x/exp/typeparams => golang.org/x/exp/typeparams v0.0.0-20230118134722-a68e582fa157 + golang.org/x/exp => golang.org/x/exp v0.0.0-20230206171751-46f607a40771 + golang.org/x/exp/typeparams => golang.org/x/exp/typeparams v0.0.0-20230206171751-46f607a40771 golang.org/x/image => golang.org/x/image v0.3.0 golang.org/x/lint => golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 golang.org/x/mobile => golang.org/x/mobile v0.0.0-20221110043201-43a038452099 @@ -495,7 +451,7 @@ replace ( golang.org/x/net => golang.org/x/net v0.5.0 golang.org/x/oauth2 => golang.org/x/oauth2 v0.4.0 golang.org/x/sync => golang.org/x/sync v0.1.0 - golang.org/x/sys => golang.org/x/sys v0.4.0 + golang.org/x/sys => golang.org/x/sys v0.5.0 golang.org/x/term => golang.org/x/term v0.4.0 golang.org/x/text => golang.org/x/text v0.6.0 golang.org/x/time => golang.org/x/time v0.3.0 @@ -505,10 +461,10 @@ replace ( gonum.org/v1/gonum => gonum.org/v1/gonum v0.12.0 gonum.org/v1/hdf5 => gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 gonum.org/v1/plot => gonum.org/v1/plot v0.12.0 - google.golang.org/api => google.golang.org/api v0.108.0 + google.golang.org/api => google.golang.org/api v0.109.0 google.golang.org/appengine => google.golang.org/appengine v1.6.7 - google.golang.org/genproto => google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 - google.golang.org/grpc => google.golang.org/grpc v1.52.0 + google.golang.org/genproto => google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 + google.golang.org/grpc => google.golang.org/grpc v1.52.3 google.golang.org/grpc/cmd/protoc-gen-go-grpc => google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 google.golang.org/protobuf => google.golang.org/protobuf v1.28.1 gopkg.in/alecthomas/kingpin.v2 => gopkg.in/alecthomas/kingpin.v2 v2.2.6 @@ -516,17 +472,12 @@ replace ( gopkg.in/gcfg.v1 => gopkg.in/gcfg.v1 v1.2.3 gopkg.in/inconshreveable/log15.v2 => gopkg.in/inconshreveable/log15.v2 v2.16.0 gopkg.in/inf.v0 => gopkg.in/inf.v0 v0.9.1 - gopkg.in/ini.v1 => gopkg.in/ini.v1 v1.67.0 - gopkg.in/natefinch/lumberjack.v2 => gopkg.in/natefinch/lumberjack.v2 v2.0.0 - gopkg.in/square/go-jose.v2 => gopkg.in/square/go-jose.v2 v2.6.0 - gopkg.in/telebot.v3 => gopkg.in/telebot.v3 v3.1.2 gopkg.in/tomb.v1 => gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 gopkg.in/warnings.v0 => gopkg.in/warnings.v0 v0.1.2 gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 => gotest.tools/v3 v3.4.0 - honnef.co/go/tools => honnef.co/go/tools v0.3.3 - inet.af/netaddr => inet.af/netaddr v0.0.0-20220811202034-502d2d690317 + honnef.co/go/tools => honnef.co/go/tools v0.4.0 k8s.io/api => k8s.io/api v0.26.0 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.26.0 k8s.io/apimachinery => k8s.io/apimachinery v0.26.0 @@ -538,7 +489,7 @@ replace ( k8s.io/gengo => k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 k8s.io/klog => k8s.io/klog v1.0.0 k8s.io/klog/v2 => k8s.io/klog/v2 v2.90.0 - k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a + k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230202010329-39b3636cbaa3 k8s.io/kubernetes => k8s.io/kubernetes v0.26.0 k8s.io/metrics => k8s.io/metrics v0.26.0 nhooyr.io/websocket => nhooyr.io/websocket v1.8.7 @@ -555,7 +506,7 @@ require ( cloud.google.com/go/storage v1.28.1 code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6 github.com/aws/aws-sdk-go v1.44.151 - github.com/envoyproxy/protoc-gen-validate v0.6.7 + github.com/envoyproxy/protoc-gen-validate v0.9.1 github.com/fsnotify/fsnotify v1.6.0 github.com/go-redis/redis/v8 v8.0.0-00010101000000-000000000000 github.com/go-sql-driver/mysql v1.7.0 @@ -597,14 +548,13 @@ require ( golang.org/x/sync v0.1.0 golang.org/x/sys v0.4.0 golang.org/x/text v0.6.0 - golang.org/x/tools v0.4.0 + golang.org/x/tools v0.4.1-0.20221208213631-3f74d914ae6d gonum.org/v1/hdf5 v0.0.0-00010101000000-000000000000 gonum.org/v1/plot v0.0.0-00010101000000-000000000000 - google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5 - google.golang.org/grpc v1.51.0 + google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa + google.golang.org/grpc v1.52.0 google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 v2.4.0 - inet.af/netaddr v0.0.0-00010101000000-000000000000 k8s.io/api v0.26.0 k8s.io/apimachinery v0.26.0 k8s.io/cli-runtime v0.0.0-00010101000000-000000000000 @@ -638,7 +588,7 @@ require ( github.com/go-openapi/swag v0.22.3 // indirect github.com/go-pdf/fpdf v0.6.0 // indirect github.com/go-toolsmith/astcopy v1.0.2 // indirect - github.com/go-toolsmith/astequal v1.0.3 // indirect + github.com/go-toolsmith/astequal v1.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -687,16 +637,14 @@ require ( go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.8.0 // indirect - go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect - go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect - golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 // indirect + golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9 // indirect golang.org/x/image v0.0.0-20220902085622-e7cb96979f69 // indirect golang.org/x/mod v0.7.0 // indirect golang.org/x/term v0.4.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/api v0.107.0 // indirect + google.golang.org/api v0.108.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 791fc96fe0..0b5ead529a 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,8 @@ cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= -cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE= -cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute v1.18.0 h1:FEigFqoDbys2cvFkZ9Fjq4gnHBP55anJ0yQyau2f9oY= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/compute/metadata v0.2.2/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= @@ -123,7 +123,7 @@ cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= -cloud.google.com/go/trace v1.5.0/go.mod h1:kYIwiTSCU0cPYfJt46LXgGPSsqIt97bYeJPAyBiZlMg= +cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= @@ -152,8 +152,8 @@ git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= github.com/Azure/azure-amqp-common-go/v3 v3.2.3/go.mod h1:7rPmbSfszeovxGfc5fSAXE4ehlXQZHpMja2OtxC2Tas= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0/go.mod h1:tZoQYdDZNOiIjdSn0dVWVfl0NEPGOJqVLzSrcFk4Is0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.1/go.mod h1:DffdKW9RFqa5VgmsjUOsS7UE7eiA5iAvYUs63bhKQ0M= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1/go.mod h1:gLa1CL2RNE4s7M3yopJ/p0iq5DdY6Yv5ZUt9MTRZOQM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0/go.mod h1:EAyXOW1F6BTJPiK2pDvmnvxOHPxoTYWoqBeIlql+QhI= github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0/go.mod h1:9V2j0jn9jDEkCkv8w/bKTNppX/d0FVA1ud77xCIP4KA= @@ -171,7 +171,7 @@ github.com/Azure/go-autorest/logger v0.2.2-0.20230117190326-9038e4a609b1/go.mod github.com/Azure/go-autorest/tracing v0.6.1-0.20230117190326-9038e4a609b1/go.mod h1:DWJLY5/ttkqsBNafOmCvqIlik+Da9EFPSpzNnCWRjMo= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= +github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1/go.mod h1:4qFor3D/HDsvBME35Xy9rwW9DecL+M2sNw1ybjPtwA0= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/GoogleCloudPlatform/cloudsql-proxy v1.33.2/go.mod h1:uqoR4sJc63p7ugW8a/vsEspOsNuehbi7ptS2CHCyOnY= @@ -187,49 +187,49 @@ github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGW github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/aws/aws-sdk-go v1.44.185 h1:stasiou+Ucx2A0RyXRyPph4sLCBxVQK7DPPK8tNcl5g= -github.com/aws/aws-sdk-go v1.44.185/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.17.3 h1:shN7NlnVzvDUgPQ+1rLMSxY8OWRNDRYtiqe0p/PgrhY= -github.com/aws/aws-sdk-go-v2 v1.17.3/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go v1.44.195 h1:d5xFL0N83Fpsq2LFiHgtBUHknCRUPGHdOlCWt/jtOJs= +github.com/aws/aws-sdk-go v1.44.195/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go-v2 v1.17.4 h1:wyC6p9Yfq6V2y98wfDsj6OnNQa4w2BLGCLIxzNhwOGY= +github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= -github.com/aws/aws-sdk-go-v2/config v1.18.9 h1:pd+QUO1dvro6vGOuhgglJV6adGunU95xSTSzsQGhKpY= -github.com/aws/aws-sdk-go-v2/config v1.18.9/go.mod h1:2Lx9yaA/McDeQS8ft+edKrmOd5ry1v1euFQ+oGwUxsM= -github.com/aws/aws-sdk-go-v2/credentials v1.13.9 h1:oxM/C8eXGsiHH+u0gZGo1++QTFPf+N5MUb1tfaaQMpU= -github.com/aws/aws-sdk-go-v2/credentials v1.13.9/go.mod h1:45DrDZTok50mEx4Uw59ym7n11Oy7G4gt0Pez2Z4ktAA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 h1:j9wi1kQ8b+e0FBVHxCqCGo4kxDU175hoDHcWAi0sauU= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21/go.mod h1:ugwW57Z5Z48bpvUyZuaPy4Kv+vEfJWnIrky7RmkBvJg= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.48 h1:3IGeA7Vh+gpp6Ptf0slDgNwFVTJEu81IiGl1v5yGZ3A= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.48/go.mod h1:kZ8I3L92ide4A8rLSEHofGn43eLE7E/m9H986uub0ns= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 h1:I3cakv2Uy1vNmmhRQmFptYDxOvBnwCdNwyw63N0RaRU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27/go.mod h1:a1/UpzeyBBerajpnP5nGZa9mGzsBn5cOKxm6NWQsvoI= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 h1:5NbbMrIzmUn/TXFqAle6mgrH5m9cOvMLRGL7pnG8tRE= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21/go.mod h1:+Gxn8jYn5k9ebfHEqlhrMirFjSW0v0C9fI+KN5vk2kE= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 h1:KeTxcGdNnQudb46oOl4d90f2I33DF/c6q3RnZAmvQdQ= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28/go.mod h1:yRZVr/iT0AqyHeep00SZ4YfBAKojXz08w3XMBscdi0c= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.18 h1:H/mF2LNWwX00lD6FlYfKpLLZgUW7oIzCBkig78x4Xok= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.18/go.mod h1:T2Ku+STrYQ1zIkL1wMvj8P3wWQaaCMKNdz70MT2FLfE= +github.com/aws/aws-sdk-go-v2/config v1.18.12 h1:fKs/I4wccmfrNRO9rdrbMO1NgLxct6H9rNMiPdBxHWw= +github.com/aws/aws-sdk-go-v2/config v1.18.12/go.mod h1:J36fOhj1LQBr+O4hJCiT8FwVvieeoSGOtPuvhKlsNu8= +github.com/aws/aws-sdk-go-v2/credentials v1.13.12 h1:Cb+HhuEnV19zHRaYYVglwvdHGMJWbdsyP4oHhw04xws= +github.com/aws/aws-sdk-go-v2/credentials v1.13.12/go.mod h1:37HG2MBroXK3jXfxVGtbM2J48ra2+Ltu+tmwr/jO0KA= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22 h1:3aMfcTmoXtTZnaT86QlVaYh+BRMbvrrmZwIQ5jWqCZQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22/go.mod h1:YGSIJyQ6D6FjKMQh16hVFSIUD54L4F7zTGePqYMYYJU= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.51 h1:iTFYCAdKzSAjGnVIUe88Hxvix0uaBqr0Rv7qJEOX5hE= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.51/go.mod h1:7Grl2gV+dx9SWrUIgwwlUvU40t7+lOSbx34XwfmsTkY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28 h1:r+XwaCLpIvCKjBIYy/HVZujQS9tsz5ohHG3ZIe0wKoE= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28/go.mod h1:3lwChorpIM/BhImY/hy+Z6jekmN92cXGPI1QJasVPYY= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22 h1:7AwGYXDdqRQYsluvKFmWoqpcOQJ4bH634SkYf3FNj/A= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22/go.mod h1:EqK7gVrIGAHyZItrD1D8B0ilgwMD1GiWAmbU4u/JHNk= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 h1:J4xhFd6zHhdF9jPP0FQJ6WknzBboGMBNjKOv4iTuw4A= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29/go.mod h1:TwuqRBGzxjQJIwH16/fOZodwXt2Zxa9/cwJC5ke4j7s= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.19 h1:FGvpyTg2LKEmMrLlpjOgkoNp9XF5CGeyAyo33LdqZW8= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.19/go.mod h1:8W88sW3PjamQpKFUQvHWWKay6ARsNvZnzU7+a4apubw= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 h1:y2+VQzC6Zh2ojtV2LoC0MNwHWc6qXv/j2vrQtlftkdA= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11/go.mod h1:iV4q2hsqtNECrfmlXyord9u4zyuFEJX9eLgLpSPzWA8= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.22 h1:kv5vRAl00tozRxSnI0IszPWGXsJOyA7hmEUHFYqsyvw= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.22/go.mod h1:Od+GU5+Yx41gryN/ZGZzAJMZ9R1yn6lgA0fD5Lo5SkQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 h1:5C6XgTViSb0bunmU57b3CT+MhxULqHH2721FVA+/kDM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21/go.mod h1:lRToEJsn+DRA9lW4O9L9+/3hjTkUzlzyzHqn8MTds5k= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.21 h1:vY5siRXvW5TrOKm2qKEf9tliBfdLxdfy0i02LOcmqUo= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.21/go.mod h1:WZvNXT1XuH8dnJM0HvOlvk+RNn7NbAPvA/ACO0QarSc= -github.com/aws/aws-sdk-go-v2/service/kms v1.20.1/go.mod h1:13sjgMH7Xu4e46+0BEDhSnNh+cImHSYS5PpBjV3oXcU= -github.com/aws/aws-sdk-go-v2/service/s3 v1.30.1 h1:kIgvVY7PHx4gIb0na/Q9gTWJWauTwhKdaqJjX8PkIY8= -github.com/aws/aws-sdk-go-v2/service/s3 v1.30.1/go.mod h1:L2l2/q76teehcW7YEsgsDjqdsDTERJeX3nOMIFlgGUE= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.18.2/go.mod h1:jAeo/PdIJZuDSwsvxJS94G4d6h8tStj7WXVuKwLHWU8= -github.com/aws/aws-sdk-go-v2/service/sns v1.19.1/go.mod h1:iTh9DgwDnFqF5LfFHNXWAxLe9zV0/XcWaMCWXIRDqXA= -github.com/aws/aws-sdk-go-v2/service/sqs v1.20.1/go.mod h1:jQhN5f4p3PALMNlUtfb/0wGIFlV7vGtJlPDVfxfNfPY= -github.com/aws/aws-sdk-go-v2/service/ssm v1.35.1/go.mod h1:Hf7wSogKP1XCJ9GgW8erZDL6IZ1NLwLN7bYdV/Gn/LI= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.0 h1:/2gzjhQowRLarkkBOGPXSRnb8sQ2RVsjdG1C/UliK/c= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.0/go.mod h1:wo/B7uUm/7zw/dWhBJ4FXuw1sySU5lyIhVg1Bu2yL9A= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0 h1:Jfly6mRxk2ZOSlbCvZfKNS7TukSx1mIzhSsqZ/IGSZI= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0/go.mod h1:TZSH7xLO7+phDtViY/KUp9WGCJMQkLJ/VpgkTFd5gh8= -github.com/aws/aws-sdk-go-v2/service/sts v1.18.1 h1:q3xG67qnKp1gsYSJY5AtTvFKY2IlmGPGrTw/Wy8EjeQ= -github.com/aws/aws-sdk-go-v2/service/sts v1.18.1/go.mod h1:+lGbb3+1ugwKrNTWcf2RT05Xmp543B06zDFTwiTLp7I= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.23 h1:c5+bNdV8E4fIPteWx4HZSkqI07oY9exbfQ7JH7Yx4PI= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.23/go.mod h1:1jcUfF+FAOEwtIcNiHPaV4TSoZqkUIPzrohmD7fb95c= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22 h1:LjFQf8hFuMO22HkV5VWGLBvmCLBCLPivUAmpdpnp4Vs= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22/go.mod h1:xt0Au8yPIwYXf/GYPy/vl4K3CgwhfQMYbrH7DlUUIws= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.22 h1:ISLJ2BKXe4zzyZ7mp5ewKECiw0U7KpLgS3S6OxY9Cm0= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.22/go.mod h1:QFVbqK54XArazLvn2wvWMRBi/jGrWii46qbr5DyPGjc= +github.com/aws/aws-sdk-go-v2/service/kms v1.20.2/go.mod h1:vdqtUOdVuf5ooy+hJ2GnzqNo94xiAA9s1xbZ1hQgRE0= +github.com/aws/aws-sdk-go-v2/service/s3 v1.30.2 h1:5EQWIFO+Hc8E2hFcXQJ1vm6ufl/PMt/6RVRDZRju2vM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.30.2/go.mod h1:SXDHd6fI2RhqB7vmAzyYQCTQnpZrIprVJvYxpzW3JAM= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.18.3/go.mod h1:hqPcyOuLU6yWIbLy3qMnQnmidgKuIEwqIlW6+chYnog= +github.com/aws/aws-sdk-go-v2/service/sns v1.20.1/go.mod h1:VN2n9SOMS1lNbh5YD7o+ho0/rgfifSrK//YYNiVVF5E= +github.com/aws/aws-sdk-go-v2/service/sqs v1.20.2/go.mod h1:1ttxGjUHZliCQMpPss1sU5+Ph/5NvdMFRzr96bv8gm0= +github.com/aws/aws-sdk-go-v2/service/ssm v1.35.2/go.mod h1:VLSz2SHUKYFSOlXB/GlXoLU6KPYQJAbw7I20TDJdyws= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.1 h1:lQKN/LNa3qqu2cDOQZybP7oL4nMGGiFqob0jZJaR8/4= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.1/go.mod h1:IgV8l3sj22nQDd5qcAGY0WenwCzCphqdbFOpfktZPrI= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.1 h1:0bLhH6DRAqox+g0LatcjGKjjhU6Eudyys6HB6DJVPj8= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.1/go.mod h1:O1YSOg3aekZibh2SngvCRRG+cRHKKlYgxf/JBF/Kr/k= +github.com/aws/aws-sdk-go-v2/service/sts v1.18.3 h1:s49mSnsBZEXjfGBkRfmK+nPqzT7Lt3+t2SmAKNyHblw= +github.com/aws/aws-sdk-go-v2/service/sts v1.18.3/go.mod h1:b+psTJn33Q4qGoDaM7ZiOVVG8uVjGI6HaZ8WBHdgDgU= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= @@ -268,11 +268,10 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu github.com/disintegration/gift v1.2.1/go.mod h1:Jh2i7f7Q2BM7Ezno3PhfezbR1xpUg9dUg3/RlKGr4HI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dvyukov/go-fuzz v0.0.0-20220726122315-1d375ef9f9f6/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 h1:RIB4cRk+lBqKK3Oy0r2gRX4ui7tuhiZq2SuTtTCi0/0= github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k= @@ -305,7 +304,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b/go.mod h1:tQ2 github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 h1:6zl3BbBhdnMkpSj2YY30qV3gDcVBGtFgVsV3+/i+mKQ= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -322,20 +321,20 @@ github.com/go-pdf/fpdf v1.4.3 h1:0ZbUVyy3URshI6fCIaCD/iTVW33dqA8zbUHuGynxAPA= github.com/go-pdf/fpdf v1.4.3/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-task/slim-sprig v2.20.0+incompatible/go.mod h1:N/mhXZITr/EQAOErEHciKvO1bFei2Lld2Ym6h96pdy0= github.com/go-text/typesetting v0.0.0-20220411150340-35994bc27a7b/go.mod h1:ZNYu5saGoMOqtkVH5T8onTwhzenDUVszI+5WFHJRaxQ= -github.com/go-toolsmith/astcopy v1.0.2 h1:YnWf5Rnh1hUudj11kei53kI57quN/VH6Hp1n+erozn0= -github.com/go-toolsmith/astcopy v1.0.2/go.mod h1:4TcEdbElGc9twQEYpVo/aieIXfHhiuLh4aLAck6dO7Y= -github.com/go-toolsmith/astequal v1.0.3 h1:+LVdyRatFS+XO78SGV4I3TCEA0AC7fKEGma+fH+674o= -github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= -github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= +github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= +github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= +github.com/go-toolsmith/astequal v1.1.0 h1:kHKm1AWqClYn15R0K1KKE4RG614D46n+nqUQ06E1dTw= +github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= +github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= +github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= @@ -346,7 +345,7 @@ github.com/gocql/gocql v1.3.1/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJr github.com/gocraft/dbr/v2 v2.7.3 h1:5/PTRiBkdD2FoHpnrCMoEUw5Wf/Cl3l3PjJ02Wm+pwM= github.com/gocraft/dbr/v2 v2.7.3/go.mod h1:8IH98S8M8J0JSEiYk0MPH26ZDUKemiQ/GvmXL5jo+Uw= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw= @@ -384,7 +383,7 @@ github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPg github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20230111200839-76d1ae5aea2b/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/pprof v0.0.0-20230131232505-5a9e8f65f08f/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= @@ -441,7 +440,7 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW 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/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= -github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josephspurrier/goversioninfo v0.0.0-20200309025242-14b0ab84c6ca/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= @@ -450,8 +449,8 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/jstemmer/go-junit-report v1.0.0/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.16-0.20230121171712-fe37dc6783c8 h1:bjJDGObEyTZ52MP9jEjuoAoqsHS/HcLtUlwz3biCsC0= -github.com/klauspost/compress v1.15.16-0.20230121171712-fe37dc6783c8/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= +github.com/klauspost/compress v1.15.16-0.20230205172721-c847bdeec5da h1:YtmQy76alWfwNxlvj3SP5at97c/CTa5Jpn8HOrI1Acc= +github.com/klauspost/compress v1.15.16-0.20230205172721-c847bdeec5da/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU= github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/kpango/fastime v1.1.6 h1:lAw1Tiwnlbsx1xZs6W9eM7/8niwabknewbmLkh/yTVo= @@ -552,7 +551,7 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= +github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/schollz/progressbar/v2 v2.15.0/go.mod h1:UdPq3prGkfQ7MOzZKlDRpYKcFqEMczbD7YmbPgpzKMI= @@ -580,7 +579,7 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= -github.com/ugorji/go/codec v1.2.8/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/vdaas/vald-client-go v1.7.0 h1:mFkd0/E7OHsAq6of04mUuYTzlbsW+j+daPjRfaau0SA= github.com/vdaas/vald-client-go v1.7.0/go.mod h1:15SmvrXHrbBmKQYwG3n/uiNN3kj5r56m3kZ5630msPA= @@ -589,7 +588,9 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= -github.com/yuin/goldmark v1.5.3/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.3.8/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.10/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/assert v1.3.1 h1:vukIABvugfNMZMQO1ABsyQDJDTVQbn+LWSMy1ol1h6A= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= @@ -619,8 +620,8 @@ go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZX go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.starlark.net v0.0.0-20230122040757-066229b0515d h1:CTI+tbxvlfu7QlBj+4QjF8YPHoDh71h0/l2tXOM2k0o= -go.starlark.net v0.0.0-20230122040757-066229b0515d/go.mod h1:1NtVfE+l6AHFaY4GmUPGHeLIW8/THkXnym5iweVgCwU= +go.starlark.net v0.0.0-20230128213706-3f75dec8e403 h1:jPeC7Exc+m8OBJUlWbBLh0O5UZPM7yU5W4adnhhbG4U= +go.starlark.net v0.0.0-20230128213706-3f75dec8e403/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= 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/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= @@ -631,18 +632,14 @@ go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go4.org/intern v0.0.0-20220617035311-6925f38cc365 h1:t9hFvR102YlOqU0fQn1wgwhNvSbHGBbbJxX9JKfU3l0= -go4.org/intern v0.0.0-20220617035311-6925f38cc365/go.mod h1:WXRv3p7T6gzt0CcJm43AAKdKVZmcQbwwC7EwquU5BZU= -go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 h1:FyBZqvoA/jbNzuAWLQE2kG820zMAkcilx6BMjGbL/E4= -go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= gocloud.dev v0.28.0 h1:PjL1f9zu8epY1pFCIHdrQnJRZzRcDyAr18hNTkXIKlQ= gocloud.dev v0.28.0/go.mod h1:nzSs01FpRYyIb/OqXLNNa+NMPZG9CdTUY/pGLgSpIN0= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/exp v0.0.0-20230118134722-a68e582fa157 h1:fiNkyhJPUvxbRPbCqY/D9qdjmPzfHcpK3P4bM4gioSY= -golang.org/x/exp v0.0.0-20230118134722-a68e582fa157/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/exp/typeparams v0.0.0-20230118134722-a68e582fa157 h1:BKmw9kHvJFeDya3z07CXNwKhiReL0LnalMGf2B16dnM= -golang.org/x/exp/typeparams v0.0.0-20230118134722-a68e582fa157/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= +golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp/typeparams v0.0.0-20230206171751-46f607a40771 h1:k+aVvDl4NAHQwLMtHN6wB0DL0737J8ScFNIufmap3/s= +golang.org/x/exp/typeparams v0.0.0-20230206171751-46f607a40771/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.3.0 h1:HTDXbdK9bjfSWkPzDJIw89W8CAtfFGduujWs33NLLsg= golang.org/x/image v0.3.0/go.mod h1:fXd9211C/0VTlYuAcOhW8dY/RtEJqODXOWBDpmYBf+A= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= @@ -655,8 +652,8 @@ golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= @@ -674,14 +671,14 @@ gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENE gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I= gonum.org/v1/plot v0.12.0 h1:y1ZNmfz/xHuHvtgFe8USZVyykQo5ERXPnspQNVK15Og= gonum.org/v1/plot v0.12.0/go.mod h1:PgiMf9+3A3PnZdJIciIXmyN1FwdAA6rXELSN761oQkw= -google.golang.org/api v0.108.0 h1:WVBc/faN0DkKtR43Q/7+tPny9ZoLZdIiAyG5Q9vFClg= -google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.109.0 h1:sW9hgHyX497PP5//NUM7nqfV8D0iDfBApqq7sOh1XR8= +google.golang.org/api v0.109.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 h1:BwjeHhu4HS48EZmu1nS7flldBIDPC3qn+HqaSQ1K4x8= -google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= -google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 h1:vArvWooPH749rNHpBGgVl+U9B9dATjiEhJzcWGlovNs= +google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ= +google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= @@ -697,9 +694,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= -inet.af/netaddr v0.0.0-20220811202034-502d2d690317 h1:U2fwK6P2EqmopP/hFLTOAjWTki0qgd4GMJn5X8wOleU= -inet.af/netaddr v0.0.0-20220811202034-502d2d690317/go.mod h1:OIezDfdzOgFhuw4HuWapWq2e9l0H9tK4F1j+ETRtF3k= +honnef.co/go/tools v0.4.0/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= k8s.io/api v0.26.0 h1:IpPlZnxBpV1xl7TGk/X6lFtpgjgntCg8PJ+qrPHAC7I= k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= k8s.io/apiextensions-apiserver v0.26.0 h1:Gy93Xo1eg2ZIkNX/8vy5xviVSxwQulsnUdQ00nEdpDo= @@ -714,8 +709,8 @@ k8s.io/component-base v0.26.0 h1:0IkChOCohtDHttmKuz+EP3j3+qKmV55rM9gIFTXA7Vs= k8s.io/component-base v0.26.0/go.mod h1:lqHwlfV1/haa14F/Z5Zizk5QmzaVf23nQzCwVOQpfC8= k8s.io/klog/v2 v2.90.0 h1:VkTxIV/FjRXn1fgNNcKGM8cfmL1Z33ZjXRTVxKCoF5M= k8s.io/klog/v2 v2.90.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a h1:s6zvHjyDQX1NtVT88pvw2tddqhqY0Bz0Gbnn+yctsFU= -k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a/go.mod h1:/BYxry62FuDzmI+i9B+X2pqfySRmSOW2ARmj5Zbqhj0= +k8s.io/kube-openapi v0.0.0-20230202010329-39b3636cbaa3 h1:vV3ZKAUX0nMjTflyfVea98dTfROpIxDaEsQws0FT2Ts= +k8s.io/kube-openapi v0.0.0-20230202010329-39b3636cbaa3/go.mod h1:/BYxry62FuDzmI+i9B+X2pqfySRmSOW2ARmj5Zbqhj0= k8s.io/metrics v0.26.0 h1:U/NzZHKDrIVGL93AUMRkqqXjOah3wGvjSnKmG/5NVCs= k8s.io/metrics v0.26.0/go.mod h1:cf5MlG4ZgWaEFZrR9+sOImhZ2ICMpIdNurA+D8snIs8= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= diff --git a/hack/go.mod.default b/hack/go.mod.default index ebfcadabc7..4ac2b16f2c 100755 --- a/hack/go.mod.default +++ b/hack/go.mod.default @@ -52,8 +52,6 @@ replace ( github.com/ajstarks/deck => github.com/ajstarks/deck latest github.com/ajstarks/deck/generate => github.com/ajstarks/deck/generate latest github.com/ajstarks/svgo => github.com/ajstarks/svgo latest - github.com/alecthomas/units => github.com/alecthomas/units latest - github.com/alexflint/go-filemutex => github.com/alexflint/go-filemutex latest github.com/antihax/optional => github.com/antihax/optional latest github.com/armon/circbuf => github.com/armon/circbuf latest github.com/armon/go-metrics => github.com/armon/go-metrics latest @@ -100,8 +98,6 @@ replace ( github.com/chzyer/logex => github.com/chzyer/logex latest github.com/chzyer/readline => github.com/chzyer/readline latest github.com/chzyer/test => github.com/chzyer/test latest - github.com/cilium/ebpf => github.com/cilium/ebpf latest - github.com/circonus-labs/circonus-gometrics => github.com/circonus-labs/circonus-gometrics latest github.com/cncf/udpa/go => github.com/cncf/udpa/go latest github.com/cncf/xds/go => github.com/cncf/xds/go latest github.com/cockroachdb/apd => github.com/cockroachdb/apd latest @@ -139,9 +135,6 @@ replace ( github.com/dennwc/varint => github.com/dennwc/varint latest github.com/devigned/tab => github.com/devigned/tab latest github.com/dgryski/go-rendezvous => github.com/dgryski/go-rendezvous latest - github.com/dgryski/go-sip13 => github.com/dgryski/go-sip13 latest - github.com/digitalocean/godo => github.com/digitalocean/godo latest - github.com/dimchansky/utfbom => github.com/dimchansky/utfbom latest github.com/dnaeon/go-vcr => github.com/dnaeon/go-vcr latest github.com/docker/cli => github.com/docker/cli latest github.com/docker/distribution => github.com/docker/distribution latest @@ -153,7 +146,6 @@ replace ( github.com/docker/go-units => github.com/docker/go-units latest github.com/docopt/docopt-go => github.com/docopt/docopt-go latest github.com/dustin/go-humanize => github.com/dustin/go-humanize latest - github.com/dvyukov/go-fuzz => github.com/dvyukov/go-fuzz latest github.com/edsrzf/mmap-go => github.com/edsrzf/mmap-go latest github.com/elazarl/goproxy => github.com/elazarl/goproxy latest github.com/emicklei/go-restful => github.com/emicklei/go-restful latest @@ -161,14 +153,11 @@ replace ( github.com/envoyproxy/go-control-plane => github.com/envoyproxy/go-control-plane latest github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate latest github.com/evanphx/json-patch => github.com/evanphx/json-patch latest - github.com/fatih/color => github.com/fatih/color latest - github.com/felixge/httpsnoop => github.com/felixge/httpsnoop latest github.com/fogleman/gg => github.com/fogleman/gg latest github.com/form3tech-oss/jwt-go => github.com/form3tech-oss/jwt-go latest github.com/fortytw2/leaktest => github.com/fortytw2/leaktest latest github.com/frankban/quicktest => github.com/frankban/quicktest latest github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify latest - github.com/ghodss/yaml => github.com/ghodss/yaml latest github.com/gin-contrib/sse => github.com/gin-contrib/sse latest github.com/gin-gonic/gin => github.com/gin-gonic/gin latest github.com/go-errors/errors => github.com/go-errors/errors latest @@ -185,8 +174,6 @@ replace ( github.com/go-logr/logr => github.com/go-logr/logr latest github.com/go-logr/stdr => github.com/go-logr/stdr latest github.com/go-logr/zapr => github.com/go-logr/zapr latest - github.com/go-openapi/analysis => github.com/go-openapi/analysis latest - github.com/go-openapi/errors => github.com/go-openapi/errors latest github.com/go-openapi/jsonpointer => github.com/go-openapi/jsonpointer latest github.com/go-openapi/jsonreference => github.com/go-openapi/jsonreference latest github.com/go-openapi/loads => github.com/go-openapi/loads latest @@ -245,10 +232,6 @@ replace ( github.com/google/uuid => github.com/google/uuid latest github.com/google/wire => github.com/google/wire latest github.com/googleapis/gax-go/v2 => github.com/googleapis/gax-go/v2 latest - github.com/googleapis/go-type-adapters => github.com/googleapis/go-type-adapters latest - github.com/gophercloud/gophercloud => github.com/gophercloud/gophercloud latest - github.com/gopherjs/gopherjs => github.com/gopherjs/gopherjs latest - github.com/gorilla/context => github.com/gorilla/context latest github.com/gorilla/mux => github.com/gorilla/mux latest github.com/gorilla/websocket => github.com/gorilla/websocket latest github.com/grafana/regexp => github.com/grafana/regexp latest @@ -300,7 +283,6 @@ replace ( github.com/jmespath/go-jmespath/internal/testify => github.com/jmespath/go-jmespath/internal/testify latest github.com/jmoiron/sqlx => github.com/jmoiron/sqlx latest github.com/joho/godotenv => github.com/joho/godotenv latest - github.com/jonboulle/clockwork => github.com/jonboulle/clockwork latest github.com/josharian/intern => github.com/josharian/intern latest github.com/json-iterator/go => github.com/json-iterator/go latest github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report latest @@ -333,10 +315,6 @@ replace ( github.com/mattn/go-shellwords => github.com/mattn/go-shellwords latest github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 latest github.com/matttproud/golang_protobuf_extensions => github.com/matttproud/golang_protobuf_extensions latest - github.com/miekg/dns => github.com/miekg/dns latest - github.com/miekg/pkcs11 => github.com/miekg/pkcs11 latest - github.com/mistifyio/go-zfs => github.com/mistifyio/go-zfs latest - github.com/mitchellh/cli => github.com/mitchellh/cli latest github.com/mitchellh/colorstring => github.com/mitchellh/colorstring latest github.com/mitchellh/go-homedir => github.com/mitchellh/go-homedir latest github.com/mitchellh/go-wordwrap => github.com/mitchellh/go-wordwrap latest @@ -355,22 +333,12 @@ replace ( github.com/morikuni/aec => github.com/morikuni/aec latest github.com/mrunalp/fileutils => github.com/mrunalp/fileutils latest github.com/munnerz/goautoneg => github.com/munnerz/goautoneg latest - github.com/mwitkow/go-conntrack => github.com/mwitkow/go-conntrack latest - github.com/mxk/go-flowrate => github.com/mxk/go-flowrate latest github.com/niemeyer/pretty => github.com/niemeyer/pretty latest github.com/nxadm/tail => github.com/nxadm/tail latest github.com/oklog/run => github.com/oklog/run latest github.com/oklog/ulid => github.com/oklog/ulid latest github.com/onsi/ginkgo => github.com/onsi/ginkgo latest github.com/onsi/gomega => github.com/onsi/gomega latest - github.com/opencontainers/go-digest => github.com/opencontainers/go-digest latest - github.com/opencontainers/image-spec => github.com/opencontainers/image-spec latest - github.com/opencontainers/runc => github.com/opencontainers/runc latest - github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec latest - github.com/opencontainers/selinux => github.com/opencontainers/selinux latest - github.com/opentracing/opentracing-go => github.com/opentracing/opentracing-go latest - github.com/pascaldekloe/goe => github.com/pascaldekloe/goe latest - github.com/pelletier/go-toml => github.com/pelletier/go-toml latest github.com/peterbourgon/diskv => github.com/peterbourgon/diskv latest github.com/phpdave11/gofpdf => github.com/phpdave11/gofpdf latest github.com/phpdave11/gofpdi => github.com/phpdave11/gofpdi latest @@ -426,18 +394,10 @@ replace ( github.com/spf13/cast => github.com/spf13/cast latest github.com/spf13/cobra => github.com/spf13/cobra latest github.com/spf13/pflag => github.com/spf13/pflag latest - github.com/stefanberger/go-pkcs11uri => github.com/stefanberger/go-pkcs11uri latest github.com/stoewer/go-strcase => github.com/stoewer/go-strcase latest github.com/stretchr/objx => github.com/stretchr/objx latest github.com/stretchr/testify => github.com/stretchr/testify latest - github.com/syndtr/gocapability => github.com/syndtr/gocapability latest - github.com/tchap/go-patricia => github.com/tchap/go-patricia latest - github.com/tidwall/pretty => github.com/tidwall/pretty latest - github.com/tmc/grpc-websocket-proxy => github.com/tmc/grpc-websocket-proxy latest - github.com/tv42/httpunix => github.com/tv42/httpunix latest - github.com/ugorji/go => github.com/ugorji/go latest github.com/ugorji/go/codec => github.com/ugorji/go/codec latest - github.com/urfave/cli => github.com/urfave/cli latest github.com/vdaas/vald-client-go => github.com/vdaas/vald-client-go latest github.com/vishvananda/netlink => github.com/vishvananda/netlink latest github.com/vishvananda/netns => github.com/vishvananda/netns latest @@ -449,8 +409,6 @@ replace ( github.com/xeipuuv/gojsonschema => github.com/xeipuuv/gojsonschema latest github.com/xiang90/probing => github.com/xiang90/probing latest github.com/xlab/treeprint => github.com/xlab/treeprint latest - github.com/youmark/pkcs8 => github.com/youmark/pkcs8 latest - github.com/yuin/goldmark => github.com/yuin/goldmark latest github.com/zeebo/assert => github.com/zeebo/assert latest github.com/zeebo/xxh3 => github.com/zeebo/xxh3 latest go.etcd.io/bbolt => go.etcd.io/bbolt latest @@ -464,7 +422,7 @@ replace ( go.mongodb.org/mongo-driver => go.mongodb.org/mongo-driver latest go.mozilla.org/pkcs7 => go.mozilla.org/pkcs7 latest go.opencensus.io => go.opencensus.io latest - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc latest + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.37.0 go.opentelemetry.io/otel => go.opentelemetry.io/otel v1.11.1 go.opentelemetry.io/otel/exporters/otlp/internal/retry => go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.1 go.opentelemetry.io/otel/exporters/otlp/otlpmetric => go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.33.0 @@ -482,8 +440,6 @@ replace ( go.uber.org/goleak => go.uber.org/goleak latest go.uber.org/multierr => go.uber.org/multierr latest go.uber.org/zap => go.uber.org/zap latest - go4.org/intern => go4.org/intern latest - go4.org/unsafe/assume-no-moving-gc => go4.org/unsafe/assume-no-moving-gc latest gocloud.dev => gocloud.dev latest golang.org/x/crypto => golang.org/x/crypto latest golang.org/x/exp => golang.org/x/exp latest @@ -516,17 +472,12 @@ replace ( gopkg.in/gcfg.v1 => gopkg.in/gcfg.v1 latest gopkg.in/inconshreveable/log15.v2 => gopkg.in/inconshreveable/log15.v2 latest gopkg.in/inf.v0 => gopkg.in/inf.v0 latest - gopkg.in/ini.v1 => gopkg.in/ini.v1 latest - gopkg.in/natefinch/lumberjack.v2 => gopkg.in/natefinch/lumberjack.v2 latest - gopkg.in/square/go-jose.v2 => gopkg.in/square/go-jose.v2 latest - gopkg.in/telebot.v3 => gopkg.in/telebot.v3 latest gopkg.in/tomb.v1 => gopkg.in/tomb.v1 latest gopkg.in/warnings.v0 => gopkg.in/warnings.v0 latest gopkg.in/yaml.v2 => gopkg.in/yaml.v2 latest gopkg.in/yaml.v3 => gopkg.in/yaml.v3 latest gotest.tools/v3 => gotest.tools/v3 latest honnef.co/go/tools => honnef.co/go/tools latest - inet.af/netaddr => inet.af/netaddr latest k8s.io/api => k8s.io/api v0.26.0 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.26.0 k8s.io/apimachinery => k8s.io/apimachinery v0.26.0 diff --git a/internal/errors/agent.go b/internal/errors/agent.go index 8ecbca94e6..579d25e761 100644 --- a/internal/errors/agent.go +++ b/internal/errors/agent.go @@ -99,4 +99,9 @@ var ( // ErrCAPINotImplemented represents an error that the function is not implemented in C API. ErrCAPINotImplemented = New("not implemented in C API") + + // ErrObjectNotFound represents a function to generate an error that the object is not found. + ErrObjectNotFound = func(err error, uuid string) error { + return Wrapf(err, "uuid %s's object not found", uuid) + } ) diff --git a/internal/errors/agent_test.go b/internal/errors/agent_test.go new file mode 100644 index 0000000000..744f5442d8 --- /dev/null +++ b/internal/errors/agent_test.go @@ -0,0 +1,109 @@ +// +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed 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 +// +// https://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 errors +package errors + +import ( + "testing" +) + +func TestErrObjectNotFound(t *testing.T) { + type args struct { + err error + uuid string + } + type want struct { + want error + } + type test struct { + name string + args args + want want + checkFunc func(want, error) error + beforeFunc func(args) + afterFunc func(args) + } + defaultCheckFunc := func(w want, got error) error { + if !Is(got, w.want) { + return Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } + return nil + } + tests := []test{ + { + name: "return a wrapped ErrObjectNotFound error when err is agent error and uuid is 550e8400-e29b-41d4", + args: args{ + err: New("agent error"), + uuid: "550e8400-e29b-41d4", + }, + want: want{ + want: New("uuid 550e8400-e29b-41d4's object not found: agent error"), + }, + }, + { + name: "return a wrapped ErrObjectNotFound error when err is agent error and uuid is empty", + args: args{ + err: New("agent error"), + uuid: "", + }, + want: want{ + want: New("uuid 's object not found: agent error"), + }, + }, + { + name: "return an ErrObjectNotFound error when err is nil and uuid is 550e8400-e29b-41d4", + args: args{ + err: nil, + uuid: "550e8400-e29b-41d4", + }, + want: want{ + want: New("uuid 550e8400-e29b-41d4's object not found"), + }, + }, + { + name: "return an ErrObjectNotFound error when err is nil and uuid is empty", + args: args{ + err: nil, + uuid: "", + }, + want: want{ + want: New("uuid 's object not found"), + }, + }, + } + + for _, tc := range tests { + test := tc + t.Run(test.name, func(tt *testing.T) { + if test.beforeFunc != nil { + test.beforeFunc(test.args) + } + if test.afterFunc != nil { + defer test.afterFunc(test.args) + } + checkFunc := test.checkFunc + if test.checkFunc == nil { + checkFunc = defaultCheckFunc + } + + got := ErrObjectNotFound(test.args.err, test.args.uuid) + if err := checkFunc(test.want, got); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} diff --git a/internal/errors/ngt.go b/internal/errors/ngt.go index c8cf536383..7008c4f9fd 100644 --- a/internal/errors/ngt.go +++ b/internal/errors/ngt.go @@ -36,11 +36,6 @@ var ( return Errorf("ngt uuid %s's object id not found", uuid) } - // ErrObjectNotFound represents a function to generate an error that the object is not found. - ErrObjectNotFound = func(err error, uuid string) error { - return Wrapf(err, "ngt uuid %s's object not found", uuid) - } - // ErrRemoveRequestedBeforeIndexing represents a function to generate an error that the object is not indexed so can not remove it. ErrRemoveRequestedBeforeIndexing = func(oid uint) error { return Errorf("object id %d is not indexed we cannot remove it", oid) diff --git a/internal/errors/ngt_test.go b/internal/errors/ngt_test.go index 2a808cb2f1..fcbb9d2bad 100644 --- a/internal/errors/ngt_test.go +++ b/internal/errors/ngt_test.go @@ -1352,93 +1352,6 @@ func TestErrObjectIDNotFound(t *testing.T) { } } -func TestErrObjectNotFound(t *testing.T) { - type args struct { - err error - uuid string - } - type want struct { - want error - } - type test struct { - name string - args args - want want - checkFunc func(want, error) error - beforeFunc func(args) - afterFunc func(args) - } - defaultCheckFunc := func(w want, got error) error { - if !Is(got, w.want) { - return Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } - return nil - } - tests := []test{ - { - name: "return a wrapped ErrObjectNotFound error when err is ngt error and uuid is 550e8400-e29b-41d4", - args: args{ - err: New("ngt error"), - uuid: "550e8400-e29b-41d4", - }, - want: want{ - want: New("ngt uuid 550e8400-e29b-41d4's object not found: ngt error"), - }, - }, - { - name: "return a wrapped ErrObjectNotFound error when err is ngt error and uuid is empty", - args: args{ - err: New("ngt error"), - uuid: "", - }, - want: want{ - want: New("ngt uuid 's object not found: ngt error"), - }, - }, - { - name: "return an ErrObjectNotFound error when err is nil and uuid is 550e8400-e29b-41d4", - args: args{ - err: nil, - uuid: "550e8400-e29b-41d4", - }, - want: want{ - want: New("ngt uuid 550e8400-e29b-41d4's object not found"), - }, - }, - { - name: "return an ErrObjectNotFound error when err is nil and uuid is empty", - args: args{ - err: nil, - uuid: "", - }, - want: want{ - want: New("ngt uuid 's object not found"), - }, - }, - } - - for _, tc := range tests { - test := tc - t.Run(test.name, func(tt *testing.T) { - if test.beforeFunc != nil { - test.beforeFunc(test.args) - } - if test.afterFunc != nil { - defer test.afterFunc(test.args) - } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc - } - - got := ErrObjectNotFound(test.args.err, test.args.uuid) - if err := checkFunc(test.want, got); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - func TestErrRemoveRequestedBeforeIndexing(t *testing.T) { type args struct { oid uint diff --git a/internal/net/grpc/client.go b/internal/net/grpc/client.go index 85496b0738..bea06c5752 100644 --- a/internal/net/grpc/client.go +++ b/internal/net/grpc/client.go @@ -315,7 +315,10 @@ func (g *gRPCClient) Range(ctx context.Context, span.End() } }() - g.conns.Range(func(addr string, p pool.Conn) bool { + if g.conns.Len() == 0 { + return errors.ErrGRPCClientConnNotFound("*") + } + return g.conns.Range(func(addr string, p pool.Conn) bool { ssctx, sspan := trace.StartSpan(sctx, apiName+"/Client.Range/"+addr) defer func() { if sspan != nil { @@ -334,7 +337,6 @@ func (g *gRPCClient) Range(ctx context.Context, } return true }) - return nil } func (g *gRPCClient) RangeConcurrent(ctx context.Context, @@ -348,7 +350,10 @@ func (g *gRPCClient) RangeConcurrent(ctx context.Context, }() eg, egctx := errgroup.New(sctx) eg.Limitation(concurrency) - g.conns.Range(func(addr string, p pool.Conn) bool { + if g.conns.Len() == 0 { + return errors.ErrGRPCClientConnNotFound("*") + } + rerr = g.conns.Range(func(addr string, p pool.Conn) bool { eg.Go(safety.RecoverFunc(func() (err error) { ssctx, sspan := trace.StartSpan(sctx, apiName+"/Client.RangeConcurrent/"+addr) defer func() { @@ -363,14 +368,19 @@ func (g *gRPCClient) RangeConcurrent(ctx context.Context, g.connectWithBackoff(ssctx, p, addr, true, func(ictx context.Context, conn *ClientConn, copts ...CallOption, ) (interface{}, error) { - return nil, f(ictx, addr, conn, copts...) + err := f(ictx, addr, conn, copts...) + return nil, err }) return nil } })) return true }) - return eg.Wait() + if rerr != nil { + return rerr + } + rerr = eg.Wait() + return rerr } func (g *gRPCClient) OrderedRange(ctx context.Context, @@ -382,10 +392,13 @@ func (g *gRPCClient) OrderedRange(ctx context.Context, span.End() } }() - if orders == nil { + if len(orders) == 0 { log.Warn("no order found for OrderedRange") return g.Range(sctx, f) } + if g.conns.Len() == 0 { + return errors.ErrGRPCClientConnNotFound("*") + } for _, addr := range orders { select { case <-sctx.Done(): @@ -422,10 +435,13 @@ func (g *gRPCClient) OrderedRangeConcurrent(ctx context.Context, span.End() } }() - if orders == nil { + if len(orders) == 0 { log.Warn("no order found for OrderedRangeConcurrent") return g.RangeConcurrent(sctx, concurrency, f) } + if g.conns.Len() == 0 { + return errors.ErrGRPCClientConnNotFound("*") + } eg, egctx := errgroup.New(sctx) eg.Limitation(concurrency) for _, order := range orders { @@ -468,6 +484,9 @@ func (g *gRPCClient) RoundRobin(ctx context.Context, f func(ctx context.Context, span.End() } }() + if g.conns.Len() == 0 { + return nil, errors.ErrGRPCClientConnNotFound("*") + } if g.bo != nil && g.atomicAddrs.Len() > 1 { var boName string if method := FromGRPCMethod(sctx); len(method) != 0 { diff --git a/internal/net/grpc/client_test.go b/internal/net/grpc/client_test.go index 55d8e4967a..da37d83686 100644 --- a/internal/net/grpc/client_test.go +++ b/internal/net/grpc/client_test.go @@ -20,6 +20,7 @@ package grpc import ( "context" "reflect" + "sync" "sync/atomic" "testing" "time" @@ -125,15 +126,11 @@ func Test_gRPCClient_StartConnectionMonitor(t *testing.T) { ctx context.Context } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -148,6 +145,7 @@ func Test_gRPCClient_StartConnectionMonitor(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -187,7 +185,7 @@ func Test_gRPCClient_StartConnectionMonitor(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -202,6 +200,7 @@ func Test_gRPCClient_StartConnectionMonitor(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -230,7 +229,7 @@ func Test_gRPCClient_StartConnectionMonitor(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -245,6 +244,7 @@ func Test_gRPCClient_StartConnectionMonitor(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -278,15 +278,11 @@ func Test_gRPCClient_StartConnectionMonitor(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -301,6 +297,7 @@ func Test_gRPCClient_StartConnectionMonitor(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -320,15 +317,11 @@ func Test_gRPCClient_Range(t *testing.T) { f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -343,6 +336,7 @@ func Test_gRPCClient_Range(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -379,7 +373,7 @@ func Test_gRPCClient_Range(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -394,6 +388,7 @@ func Test_gRPCClient_Range(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -423,7 +418,7 @@ func Test_gRPCClient_Range(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -438,6 +433,7 @@ func Test_gRPCClient_Range(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -471,15 +467,11 @@ func Test_gRPCClient_Range(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -494,6 +486,7 @@ func Test_gRPCClient_Range(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -514,15 +507,11 @@ func Test_gRPCClient_RangeConcurrent(t *testing.T) { f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -537,6 +526,7 @@ func Test_gRPCClient_RangeConcurrent(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -574,7 +564,7 @@ func Test_gRPCClient_RangeConcurrent(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -589,6 +579,7 @@ func Test_gRPCClient_RangeConcurrent(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -619,7 +610,7 @@ func Test_gRPCClient_RangeConcurrent(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -634,6 +625,7 @@ func Test_gRPCClient_RangeConcurrent(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -667,15 +659,11 @@ func Test_gRPCClient_RangeConcurrent(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -690,6 +678,7 @@ func Test_gRPCClient_RangeConcurrent(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -710,15 +699,11 @@ func Test_gRPCClient_OrderedRange(t *testing.T) { f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -733,6 +718,7 @@ func Test_gRPCClient_OrderedRange(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -770,7 +756,7 @@ func Test_gRPCClient_OrderedRange(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -785,6 +771,7 @@ func Test_gRPCClient_OrderedRange(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -815,7 +802,7 @@ func Test_gRPCClient_OrderedRange(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -830,6 +817,7 @@ func Test_gRPCClient_OrderedRange(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -863,15 +851,11 @@ func Test_gRPCClient_OrderedRange(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -886,6 +870,7 @@ func Test_gRPCClient_OrderedRange(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -907,15 +892,11 @@ func Test_gRPCClient_OrderedRangeConcurrent(t *testing.T) { f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -930,6 +911,7 @@ func Test_gRPCClient_OrderedRangeConcurrent(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -968,7 +950,7 @@ func Test_gRPCClient_OrderedRangeConcurrent(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -983,6 +965,7 @@ func Test_gRPCClient_OrderedRangeConcurrent(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1014,7 +997,7 @@ func Test_gRPCClient_OrderedRangeConcurrent(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1029,6 +1012,7 @@ func Test_gRPCClient_OrderedRangeConcurrent(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1062,15 +1046,11 @@ func Test_gRPCClient_OrderedRangeConcurrent(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -1085,6 +1065,7 @@ func Test_gRPCClient_OrderedRangeConcurrent(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -1104,15 +1085,11 @@ func Test_gRPCClient_RoundRobin(t *testing.T) { f func(ctx context.Context, conn *ClientConn, copts ...CallOption) (interface{}, error) } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -1127,6 +1104,7 @@ func Test_gRPCClient_RoundRobin(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -1167,7 +1145,7 @@ func Test_gRPCClient_RoundRobin(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1182,6 +1160,7 @@ func Test_gRPCClient_RoundRobin(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1211,7 +1190,7 @@ func Test_gRPCClient_RoundRobin(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1226,6 +1205,7 @@ func Test_gRPCClient_RoundRobin(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1259,15 +1239,11 @@ func Test_gRPCClient_RoundRobin(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -1282,6 +1258,7 @@ func Test_gRPCClient_RoundRobin(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -1302,15 +1279,11 @@ func Test_gRPCClient_Do(t *testing.T) { f func(ctx context.Context, conn *ClientConn, copts ...CallOption) (interface{}, error) } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -1325,6 +1298,7 @@ func Test_gRPCClient_Do(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -1366,7 +1340,7 @@ func Test_gRPCClient_Do(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1381,6 +1355,7 @@ func Test_gRPCClient_Do(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1411,7 +1386,7 @@ func Test_gRPCClient_Do(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1426,6 +1401,7 @@ func Test_gRPCClient_Do(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1459,15 +1435,11 @@ func Test_gRPCClient_Do(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -1482,6 +1454,7 @@ func Test_gRPCClient_Do(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -1504,15 +1477,11 @@ func Test_gRPCClient_connectWithBackoff(t *testing.T) { f func(ctx context.Context, conn *ClientConn, copts ...CallOption) (interface{}, error) } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -1527,6 +1496,7 @@ func Test_gRPCClient_connectWithBackoff(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -1570,7 +1540,7 @@ func Test_gRPCClient_connectWithBackoff(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1585,6 +1555,7 @@ func Test_gRPCClient_connectWithBackoff(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1617,7 +1588,7 @@ func Test_gRPCClient_connectWithBackoff(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1632,6 +1603,7 @@ func Test_gRPCClient_connectWithBackoff(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1665,15 +1637,11 @@ func Test_gRPCClient_connectWithBackoff(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -1688,6 +1656,7 @@ func Test_gRPCClient_connectWithBackoff(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -1703,15 +1672,11 @@ func Test_gRPCClient_connectWithBackoff(t *testing.T) { func Test_gRPCClient_GetDialOption(t *testing.T) { type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -1726,6 +1691,7 @@ func Test_gRPCClient_GetDialOption(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -1757,7 +1723,7 @@ func Test_gRPCClient_GetDialOption(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1772,6 +1738,7 @@ func Test_gRPCClient_GetDialOption(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1797,7 +1764,7 @@ func Test_gRPCClient_GetDialOption(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1812,6 +1779,7 @@ func Test_gRPCClient_GetDialOption(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1845,15 +1813,11 @@ func Test_gRPCClient_GetDialOption(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -1868,6 +1832,7 @@ func Test_gRPCClient_GetDialOption(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -1883,15 +1848,11 @@ func Test_gRPCClient_GetDialOption(t *testing.T) { func Test_gRPCClient_GetCallOption(t *testing.T) { type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -1906,6 +1867,7 @@ func Test_gRPCClient_GetCallOption(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -1937,7 +1899,7 @@ func Test_gRPCClient_GetCallOption(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1952,6 +1914,7 @@ func Test_gRPCClient_GetCallOption(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -1977,7 +1940,7 @@ func Test_gRPCClient_GetCallOption(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -1992,6 +1955,7 @@ func Test_gRPCClient_GetCallOption(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2025,15 +1989,11 @@ func Test_gRPCClient_GetCallOption(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -2048,6 +2008,7 @@ func Test_gRPCClient_GetCallOption(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -2063,15 +2024,11 @@ func Test_gRPCClient_GetCallOption(t *testing.T) { func Test_gRPCClient_GetBackoff(t *testing.T) { type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -2086,6 +2043,7 @@ func Test_gRPCClient_GetBackoff(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -2117,7 +2075,7 @@ func Test_gRPCClient_GetBackoff(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2132,6 +2090,7 @@ func Test_gRPCClient_GetBackoff(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2157,7 +2116,7 @@ func Test_gRPCClient_GetBackoff(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2172,6 +2131,7 @@ func Test_gRPCClient_GetBackoff(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2205,15 +2165,11 @@ func Test_gRPCClient_GetBackoff(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -2228,6 +2184,7 @@ func Test_gRPCClient_GetBackoff(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -2248,15 +2205,11 @@ func Test_gRPCClient_Connect(t *testing.T) { dopts []DialOption } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -2271,6 +2224,7 @@ func Test_gRPCClient_Connect(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -2312,7 +2266,7 @@ func Test_gRPCClient_Connect(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2327,6 +2281,7 @@ func Test_gRPCClient_Connect(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2357,7 +2312,7 @@ func Test_gRPCClient_Connect(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2372,6 +2327,7 @@ func Test_gRPCClient_Connect(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2405,15 +2361,11 @@ func Test_gRPCClient_Connect(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -2428,6 +2380,7 @@ func Test_gRPCClient_Connect(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -2447,15 +2400,11 @@ func Test_gRPCClient_IsConnected(t *testing.T) { addr string } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -2470,6 +2419,7 @@ func Test_gRPCClient_IsConnected(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -2506,7 +2456,7 @@ func Test_gRPCClient_IsConnected(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2521,6 +2471,7 @@ func Test_gRPCClient_IsConnected(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2550,7 +2501,7 @@ func Test_gRPCClient_IsConnected(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2565,6 +2516,7 @@ func Test_gRPCClient_IsConnected(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2598,15 +2550,11 @@ func Test_gRPCClient_IsConnected(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -2621,6 +2569,7 @@ func Test_gRPCClient_IsConnected(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -2640,15 +2589,11 @@ func Test_gRPCClient_Disconnect(t *testing.T) { addr string } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -2663,6 +2608,7 @@ func Test_gRPCClient_Disconnect(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -2699,7 +2645,7 @@ func Test_gRPCClient_Disconnect(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2714,6 +2660,7 @@ func Test_gRPCClient_Disconnect(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2743,7 +2690,7 @@ func Test_gRPCClient_Disconnect(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2758,6 +2705,7 @@ func Test_gRPCClient_Disconnect(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2791,15 +2739,11 @@ func Test_gRPCClient_Disconnect(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -2814,6 +2758,7 @@ func Test_gRPCClient_Disconnect(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -2829,15 +2774,11 @@ func Test_gRPCClient_Disconnect(t *testing.T) { func Test_gRPCClient_ConnectedAddrs(t *testing.T) { type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -2852,6 +2793,7 @@ func Test_gRPCClient_ConnectedAddrs(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -2883,7 +2825,7 @@ func Test_gRPCClient_ConnectedAddrs(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2898,6 +2840,7 @@ func Test_gRPCClient_ConnectedAddrs(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2923,7 +2866,7 @@ func Test_gRPCClient_ConnectedAddrs(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -2938,6 +2881,7 @@ func Test_gRPCClient_ConnectedAddrs(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -2971,15 +2915,11 @@ func Test_gRPCClient_ConnectedAddrs(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -2994,6 +2934,7 @@ func Test_gRPCClient_ConnectedAddrs(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, @@ -3012,15 +2953,11 @@ func Test_gRPCClient_Close(t *testing.T) { ctx context.Context } type fields struct { - addrs map[string]struct{} - atomicAddrs AtomicAddrs - poolSize uint64 - clientCount uint64 - conns struct { - read atomic.Value - dirty map[string]*entryGrpcConns - misses int - } + addrs map[string]struct{} + atomicAddrs AtomicAddrs + poolSize uint64 + clientCount uint64 + conns grpcConns hcDur time.Duration prDur time.Duration dialer net.Dialer @@ -3035,6 +2972,7 @@ func Test_gRPCClient_Close(t *testing.T) { gbo gbackoff.Config mcd time.Duration group singleflight.Group + crl sync.Map ech <-chan error monitorRunning atomic.Value stopMonitor context.CancelFunc @@ -3070,7 +3008,7 @@ func Test_gRPCClient_Close(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -3085,6 +3023,7 @@ func Test_gRPCClient_Close(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -3113,7 +3052,7 @@ func Test_gRPCClient_Close(t *testing.T) { atomicAddrs: nil, poolSize: 0, clientCount: 0, - conns: struct{}, + conns: grpcConns{}, hcDur: nil, prDur: nil, dialer: nil, @@ -3128,6 +3067,7 @@ func Test_gRPCClient_Close(t *testing.T) { gbo: nil, mcd: nil, group: nil, + crl: sync.Map{}, ech: nil, monitorRunning: nil, stopMonitor: nil, @@ -3161,15 +3101,11 @@ func Test_gRPCClient_Close(t *testing.T) { checkFunc = defaultCheckFunc } g := &gRPCClient{ - addrs: test.fields.addrs, - atomicAddrs: test.fields.atomicAddrs, - poolSize: test.fields.poolSize, - clientCount: test.fields.clientCount, - conns: grpcConns{ - read: test.fields.conns.read, - dirty: test.fields.conns.dirty, - misses: test.fields.conns.misses, - }, + addrs: test.fields.addrs, + atomicAddrs: test.fields.atomicAddrs, + poolSize: test.fields.poolSize, + clientCount: test.fields.clientCount, + conns: test.fields.conns, hcDur: test.fields.hcDur, prDur: test.fields.prDur, dialer: test.fields.dialer, @@ -3184,6 +3120,7 @@ func Test_gRPCClient_Close(t *testing.T) { gbo: test.fields.gbo, mcd: test.fields.mcd, group: test.fields.group, + crl: test.fields.crl, ech: test.fields.ech, monitorRunning: test.fields.monitorRunning, stopMonitor: test.fields.stopMonitor, diff --git a/internal/net/grpc/grpcconns.go b/internal/net/grpc/grpcconns.go index 20a5631f05..4896d1520e 100644 --- a/internal/net/grpc/grpcconns.go +++ b/internal/net/grpc/grpcconns.go @@ -22,6 +22,7 @@ import ( "sync/atomic" "unsafe" + "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/net/grpc/pool" ) @@ -152,7 +153,7 @@ func (e *entryGrpcConns) delete() (hadValue bool) { } } -func (m *grpcConns) Range(f func(key string, value pool.Conn) bool) { +func (m *grpcConns) Range(f func(key string, value pool.Conn) bool) (err error) { read, _ := m.read.Load().(readOnlyGrpcConns) if read.amended { m.mu.Lock() @@ -166,15 +167,38 @@ func (m *grpcConns) Range(f func(key string, value pool.Conn) bool) { m.mu.Unlock() } + var cnt int for k, e := range read.m { v, ok := e.load() if !ok { continue } + cnt++ if !f(k, v) { - break + return nil } } + if cnt == 0 { + return errors.ErrGRPCClientConnNotFound("*") + } + return nil +} + +func (m *grpcConns) Len() int { + read, _ := m.read.Load().(readOnlyGrpcConns) + if read.amended { + m.mu.Lock() + read, _ = m.read.Load().(readOnlyGrpcConns) + if read.amended { + read = readOnlyGrpcConns{m: m.dirty} + m.read.Store(read) + m.dirty = nil + m.misses = 0 + } + m.mu.Unlock() + } + + return len(read.m) } func (m *grpcConns) missLocked() { diff --git a/internal/net/grpc/grpcconns_test.go b/internal/net/grpc/grpcconns_test.go index 1b5d716b2b..3af59b1858 100644 --- a/internal/net/grpc/grpcconns_test.go +++ b/internal/net/grpc/grpcconns_test.go @@ -19,6 +19,7 @@ package grpc import ( "reflect" + "sync" "sync/atomic" "testing" "unsafe" @@ -118,6 +119,7 @@ func Test_grpcConns_Load(t *testing.T) { key string } type fields struct { + mu sync.Mutex read atomic.Value dirty map[string]*entryGrpcConns misses int @@ -153,6 +155,7 @@ func Test_grpcConns_Load(t *testing.T) { key: "", }, fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -177,6 +180,7 @@ func Test_grpcConns_Load(t *testing.T) { key: "", }, fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -210,6 +214,7 @@ func Test_grpcConns_Load(t *testing.T) { checkFunc = defaultCheckFunc } m := &grpcConns{ + mu: test.fields.mu, read: test.fields.read, dirty: test.fields.dirty, misses: test.fields.misses, @@ -321,6 +326,7 @@ func Test_grpcConns_Store(t *testing.T) { value pool.Conn } type fields struct { + mu sync.Mutex read atomic.Value dirty map[string]*entryGrpcConns misses int @@ -348,6 +354,7 @@ func Test_grpcConns_Store(t *testing.T) { value: nil, }, fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -373,6 +380,7 @@ func Test_grpcConns_Store(t *testing.T) { value: nil, }, fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -406,6 +414,7 @@ func Test_grpcConns_Store(t *testing.T) { checkFunc = defaultCheckFunc } m := &grpcConns{ + mu: test.fields.mu, read: test.fields.read, dirty: test.fields.dirty, misses: test.fields.misses, @@ -703,6 +712,7 @@ func Test_grpcConns_Delete(t *testing.T) { key string } type fields struct { + mu sync.Mutex read atomic.Value dirty map[string]*entryGrpcConns misses int @@ -729,6 +739,7 @@ func Test_grpcConns_Delete(t *testing.T) { key: "", }, fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -753,6 +764,7 @@ func Test_grpcConns_Delete(t *testing.T) { key: "", }, fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -786,6 +798,7 @@ func Test_grpcConns_Delete(t *testing.T) { checkFunc = defaultCheckFunc } m := &grpcConns{ + mu: test.fields.mu, read: test.fields.read, dirty: test.fields.dirty, misses: test.fields.misses, @@ -892,21 +905,27 @@ func Test_grpcConns_Range(t *testing.T) { f func(key string, value pool.Conn) bool } type fields struct { + mu sync.Mutex read atomic.Value dirty map[string]*entryGrpcConns misses int } - type want struct{} + type want struct { + err error + } type test struct { name string args args fields fields want want - checkFunc func(want) error + checkFunc func(want, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want) error { + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } return nil } tests := []test{ @@ -918,6 +937,7 @@ func Test_grpcConns_Range(t *testing.T) { f: nil, }, fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -942,6 +962,7 @@ func Test_grpcConns_Range(t *testing.T) { f: nil, }, fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -975,13 +996,114 @@ func Test_grpcConns_Range(t *testing.T) { checkFunc = defaultCheckFunc } m := &grpcConns{ + mu: test.fields.mu, read: test.fields.read, dirty: test.fields.dirty, misses: test.fields.misses, } - m.Range(test.args.f) - if err := checkFunc(test.want); err != nil { + err := m.Range(test.args.f) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_grpcConns_Len(t *testing.T) { + type fields struct { + mu sync.Mutex + read atomic.Value + dirty map[string]*entryGrpcConns + misses int + } + type want struct { + want int + } + type test struct { + name string + fields fields + want want + checkFunc func(want, int) error + beforeFunc func(*testing.T) + afterFunc func(*testing.T) + } + defaultCheckFunc := func(w want, got int) error { + if !reflect.DeepEqual(got, w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + fields: fields { + mu: sync.Mutex{}, + read: nil, + dirty: nil, + misses: 0, + }, + want: want{}, + checkFunc: defaultCheckFunc, + beforeFunc: func(t *testing.T,) { + t.Helper() + }, + afterFunc: func(t *testing.T,) { + t.Helper() + }, + }, + */ + + // TODO test cases + /* + func() test { + return test { + name: "test_case_2", + fields: fields { + mu: sync.Mutex{}, + read: nil, + dirty: nil, + misses: 0, + }, + want: want{}, + checkFunc: defaultCheckFunc, + beforeFunc: func(t *testing.T,) { + t.Helper() + }, + afterFunc: func(t *testing.T,) { + t.Helper() + }, + } + }(), + */ + } + + for _, tc := range tests { + test := tc + t.Run(test.name, func(tt *testing.T) { + tt.Parallel() + defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) + if test.beforeFunc != nil { + test.beforeFunc(tt) + } + if test.afterFunc != nil { + defer test.afterFunc(tt) + } + checkFunc := test.checkFunc + if test.checkFunc == nil { + checkFunc = defaultCheckFunc + } + m := &grpcConns{ + mu: test.fields.mu, + read: test.fields.read, + dirty: test.fields.dirty, + misses: test.fields.misses, + } + + got := m.Len() + if err := checkFunc(test.want, got); err != nil { tt.Errorf("error = %v", err) } }) @@ -990,6 +1112,7 @@ func Test_grpcConns_Range(t *testing.T) { func Test_grpcConns_missLocked(t *testing.T) { type fields struct { + mu sync.Mutex read atomic.Value dirty map[string]*entryGrpcConns misses int @@ -1012,6 +1135,7 @@ func Test_grpcConns_missLocked(t *testing.T) { { name: "test_case_1", fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -1033,6 +1157,7 @@ func Test_grpcConns_missLocked(t *testing.T) { return test { name: "test_case_2", fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -1066,6 +1191,7 @@ func Test_grpcConns_missLocked(t *testing.T) { checkFunc = defaultCheckFunc } m := &grpcConns{ + mu: test.fields.mu, read: test.fields.read, dirty: test.fields.dirty, misses: test.fields.misses, @@ -1081,6 +1207,7 @@ func Test_grpcConns_missLocked(t *testing.T) { func Test_grpcConns_dirtyLocked(t *testing.T) { type fields struct { + mu sync.Mutex read atomic.Value dirty map[string]*entryGrpcConns misses int @@ -1103,6 +1230,7 @@ func Test_grpcConns_dirtyLocked(t *testing.T) { { name: "test_case_1", fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -1124,6 +1252,7 @@ func Test_grpcConns_dirtyLocked(t *testing.T) { return test { name: "test_case_2", fields: fields { + mu: sync.Mutex{}, read: nil, dirty: nil, misses: 0, @@ -1157,6 +1286,7 @@ func Test_grpcConns_dirtyLocked(t *testing.T) { checkFunc = defaultCheckFunc } m := &grpcConns{ + mu: test.fields.mu, read: test.fields.read, dirty: test.fields.dirty, misses: test.fields.misses, diff --git a/internal/net/grpc/logger/logger_test.go b/internal/net/grpc/logger/logger_test.go index e37dd7047f..43a6cbbe7e 100644 --- a/internal/net/grpc/logger/logger_test.go +++ b/internal/net/grpc/logger/logger_test.go @@ -30,7 +30,6 @@ func TestMain(m *testing.M) { } func TestInit(t *testing.T) { - t.Parallel() type test struct { name string checkFunc func() error diff --git a/internal/net/net.go b/internal/net/net.go index e40d4cef67..0597b30e1e 100644 --- a/internal/net/net.go +++ b/internal/net/net.go @@ -21,6 +21,7 @@ import ( "context" "math" "net" + "net/netip" "strconv" "sync" "syscall" @@ -30,7 +31,6 @@ import ( "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/safety" "github.com/vdaas/vald/internal/strings" - "inet.af/netaddr" ) type ( @@ -161,7 +161,7 @@ func Parse(addr string) (host string, port uint16, isLocal, isIPv4, isIPv6 bool, host = addr } - ip, nerr := netaddr.ParseIP(host) + ip, nerr := netip.ParseAddr(host) if nerr != nil { log.Debugf("host: %s,\tport: %d,\tip: %#v,\terror: %v", host, port, ip, nerr) } @@ -175,7 +175,7 @@ func Parse(addr string) (host string, port uint16, isLocal, isIPv4, isIPv6 bool, nerr == nil && ip.Is4(), // check is IPv6 or not // ic >= 2, - nerr == nil && (ip.Is6() || ip.Is4in6()), + nerr == nil && (ip.Is6() || ip.Is4In6()), // Split error err } @@ -284,9 +284,9 @@ func LoadLocalIP() string { } for _, address := range addrs { if ipn, ok := address.(*net.IPNet); ok { - if ip, ok := netaddr.FromStdIPNet(ipn); ok && ip.IsValid() && ip.IP().IsLoopback() && - (ip.IP().Is4() || ip.IP().Is6() || ip.IP().Is4in6()) { - return ip.IP().String() + if ip, err := netip.ParsePrefix(ipn.String()); err == nil && ip.IsValid() && ip.Addr().IsLoopback() && + (ip.Addr().Is4() || ip.Addr().Is6() || ip.Addr().Is4In6()) { + return ip.Addr().String() } } } diff --git a/internal/observability/exporter/otlp/otlp.go b/internal/observability/exporter/otlp/otlp.go index a64a41cdc0..a0c2c96285 100644 --- a/internal/observability/exporter/otlp/otlp.go +++ b/internal/observability/exporter/otlp/otlp.go @@ -32,7 +32,7 @@ import ( "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/resource" "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.4.0" + semconv "go.opentelemetry.io/otel/semconv/v1.12.0" ) // Metrics and Trace attribute keys. diff --git a/internal/observability/trace/status.go b/internal/observability/trace/status.go index b4d4eefc62..199d4175a0 100644 --- a/internal/observability/trace/status.go +++ b/internal/observability/trace/status.go @@ -24,6 +24,8 @@ import ( semconv "go.opentelemetry.io/otel/semconv/v1.12.0" ) +type Attributes = []attribute.KeyValue + const ( grpcMsgAttributeKey = attribute.Key("rpc.grpc.message") StatusOK = ocodes.Ok diff --git a/pkg/gateway/lb/handler/grpc/handler.go b/pkg/gateway/lb/handler/grpc/handler.go index eb6aff0e43..e9fa0f954d 100644 --- a/pkg/gateway/lb/handler/grpc/handler.go +++ b/pkg/gateway/lb/handler/grpc/handler.go @@ -68,34 +68,16 @@ func New(opts ...Option) vald.Server { return s } -func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *payload.Object_ID, err error) { - ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.ExistsRPCName), apiName+"/"+vald.ExistsRPCName) +func (s *server) exists(ctx context.Context, uuid string) (id *payload.Object_ID, err error) { + ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.ExistsRPCName+"/exists") defer func() { if span != nil { span.End() } }() - uuid := meta.GetId() if len(uuid) == 0 { err = errors.ErrInvalidUUID(uuid) - err = status.WrapWithInvalidArgument(vald.ExistsRPCName+" API invalid argument for uuid \""+uuid+"\" detected", err, - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(meta), - }, - &errdetails.BadRequest{ - FieldViolations: []*errdetails.BadRequestFieldViolation{ - { - Field: "uuid", - Description: err.Error(), - }, - }, - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.ExistsRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }) log.Warn(err) if span != nil { span.RecordError(err) @@ -113,59 +95,53 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo ctx, cancel = context.WithCancel(ctx) var once sync.Once ech <- s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.Client, copts ...grpc.CallOption) error { - sctx, sspan := trace.StartSpan(ctx, apiName+"."+vald.ExistsRPCName+"/"+target) + sctx, sspan := trace.StartSpan(ctx, apiName+"."+vald.ExistsRPCName+"/exists/BroadCast/"+target) defer func() { if sspan != nil { sspan.End() } }() - oid, err := vc.Exists(sctx, &payload.Object_ID{ + meta := &payload.Object_ID{ Id: uuid, - }, copts...) + } + oid, err := vc.Exists(sctx, meta, copts...) if err != nil { + var ( + attrs trace.Attributes + st *status.Status + msg string + ) switch { case errors.Is(err, context.Canceled), errors.Is(err, errors.ErrRPCCallFailed(target, context.Canceled)): - if sspan != nil { - sspan.RecordError(err) - sspan.SetAttributes(trace.StatusCodeCancelled( - errdetails.ValdGRPCResourceTypePrefix + - "/vald.v1." + vald.ExistsRPCName + ".BroadCast/" + - target + " canceled: " + err.Error())...) - sspan.SetStatus(trace.StatusError, err.Error()) - } - return nil + attrs = trace.StatusCodeCancelled( + errdetails.ValdGRPCResourceTypePrefix + + "/vald.v1." + vald.ExistsRPCName + ".BroadCast/" + + target + " canceled: " + err.Error()) case errors.Is(err, context.DeadlineExceeded), errors.Is(err, errors.ErrRPCCallFailed(target, context.DeadlineExceeded)): - if sspan != nil { - sspan.RecordError(err) - sspan.SetAttributes(trace.StatusCodeDeadlineExceeded( - errdetails.ValdGRPCResourceTypePrefix + - "/vald.v1." + vald.ExistsRPCName + ".BroadCast/" + - target + " deadline_exceeded: " + err.Error())...) - sspan.SetStatus(trace.StatusError, err.Error()) - } - return nil + attrs = trace.StatusCodeDeadlineExceeded( + errdetails.ValdGRPCResourceTypePrefix + + "/vald.v1." + vald.ExistsRPCName + ".BroadCast/" + + target + " deadline_exceeded: " + err.Error()) + default: + st, msg, err = status.ParseError(err, codes.NotFound, "error "+vald.ExistsRPCName+" API meta "+uuid+"'s uuid not found", + &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(meta), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.ExistsRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }) + attrs = trace.FromGRPCStatus(st.Code(), msg) } - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.NotFound, "error "+vald.ExistsRPCName+" API meta "+uuid+"'s uuid not found", - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(meta), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.ExistsRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }) if sspan != nil { sspan.RecordError(err) - sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetAttributes(attrs...) sspan.SetStatus(trace.StatusError, err.Error()) } - if err != nil && st.Code() != codes.NotFound { + if err != nil && st != nil && st.Code() != codes.NotFound { return err } return nil @@ -186,30 +162,87 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo case id = <-ich: case err = <-ech: } - if err != nil || id == nil || id.GetId() == "" { - if err == nil { - err = errors.ErrObjectIDNotFound(uuid) + if err != nil { + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeNotFound(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) } - st, msg, err := status.ParseError(err, codes.NotFound, "error "+vald.ExistsRPCName+" API meta "+uuid+"'s uuid not found", - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(meta), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.ExistsRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }) + return nil, err + } + if id == nil || id.GetId() == "" { + err = errors.ErrObjectIDNotFound(uuid) if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(trace.StatusCodeNotFound(err.Error())...) span.SetStatus(trace.StatusError, err.Error()) } - return nil, err } return id, nil } +func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *payload.Object_ID, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.ExistsRPCName), apiName+"/"+vald.ExistsRPCName) + defer func() { + if span != nil { + span.End() + } + }() + uuid := meta.GetId() + id, err = s.exists(ctx, uuid) + if err == nil { + return id, nil + } + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(meta), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.ExistsRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } + var attrs trace.Attributes + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument(vald.ExistsRPCName+" API invalid argument for uuid \""+uuid+"\" detected", err, reqInfo, resInfo, &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)): + err = status.WrapWithNotFound(vald.ExistsRPCName+" API id "+uuid+"'s data not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeNotFound(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.ExistsRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.ExistsRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.ExistsRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Unknown, vald.ExistsRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Debug(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err +} + func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.SearchRPCName), apiName+"/"+vald.SearchRPCName) defer func() { @@ -287,13 +320,17 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) } }() uuid := req.GetId() + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.SearchByIDRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } if len(uuid) == 0 { err = errors.ErrInvalidMetaDataConfig - err = status.WrapWithInvalidArgument(vald.SearchByIDRPCName+" API invalid uuid", err, - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - ServingData: errdetails.Serialize(req), - }, + err = status.WrapWithInvalidArgument(vald.SearchByIDRPCName+" API invalid uuid", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -301,10 +338,6 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) Description: err.Error(), }, }, - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.SearchByIDRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) if span != nil { span.RecordError(err) @@ -313,13 +346,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) } return nil, err } - oreq := &payload.Object_VectorRequest{ - Id: &payload.Object_ID{ - Id: uuid, - }, - Filters: req.GetConfig().GetEgressFilters(), - } - vec, err := s.GetObject(ctx, oreq) + vec, err := s.getObject(ctx, uuid) cfg := req.GetConfig() mn := cfg.GetMinNum() if req.Config != nil { @@ -336,15 +363,54 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) EgressFilters: cfg.GetEgressFilters(), } if err != nil { - _, _, err := status.ParseError(err, codes.NotFound, vald.SearchByIDRPCName+" API failed to get uuid "+req.GetId()+"'s object", - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - ServingData: errdetails.Serialize(oreq), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.SearchByIDRPCName + "." + vald.GetObjectRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }) + var ( + attrs trace.Attributes + st *status.Status + msg string + ) + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument( + vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API invalid argument for uuid \""+uuid+"\" detected", + err, + reqInfo, + resInfo, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)), errors.Is(err, errors.ErrObjectNotFound(nil, uuid)): + err = nil + default: + st, msg, err = status.ParseError(err, codes.Unknown, vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) + if st == nil || st.Code() == codes.NotFound { + err = nil + } + } + if err != nil { + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } var serr error res, serr = s.doSearch(ctx, scfg, func(ctx context.Context, vc vald.Client, copts ...grpc.CallOption) (*payload.Search_Response, error) { return vc.SearchByID(ctx, req, copts...) @@ -353,14 +419,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) return res, nil } err = errors.Wrap(err, serr.Error()) - st, msg, serr := status.ParseError(err, codes.Internal, vald.SearchByIDRPCName+" API failed to process search request", - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.SearchByIDRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }) + st, msg, serr = status.ParseError(err, codes.Internal, vald.SearchByIDRPCName+" API failed to process search request", reqInfo, resInfo) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -373,14 +432,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) Config: scfg, }) if err != nil { - _, _, err := status.ParseError(err, codes.Internal, vald.SearchByIDRPCName+" API failed to process search request", - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.SearchByIDRPCName + "." + vald.SearchRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) + _, _, err := status.ParseError(err, codes.Internal, vald.SearchByIDRPCName+" API failed to process search request", reqInfo, resInfo, info.Get()) var serr error res, serr = s.doSearch(ctx, scfg, func(ctx context.Context, vc vald.Client, copts ...grpc.CallOption) (*payload.Search_Response, error) { return vc.SearchByID(ctx, req, copts...) @@ -388,14 +440,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) if serr == nil { return res, nil } - st, msg, serr := status.ParseError(serr, codes.Internal, vald.SearchByIDRPCName+" API failed to process search request", - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.SearchByIDRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }) + st, msg, serr := status.ParseError(serr, codes.Internal, vald.SearchByIDRPCName+" API failed to process search request", reqInfo, resInfo) err = errors.Wrap(err, serr.Error()) if span != nil { span.RecordError(err) @@ -574,6 +619,23 @@ func (s *server) doSearch(ctx context.Context, cfg *payload.Search_Config, case <-ectx.Done(): err = eg.Wait() close(dch) + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal("search API connection not found", err, + &errdetails.RequestInfo{ + // RequestId: cfg.GetRequestId(), + ServingData: errdetails.Serialize(cfg), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1.search", + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } // range over channel patter to check remaining channel's data for vald's search accuracy for dist := range dch { add(dist.distance, dist.raw) @@ -812,39 +874,15 @@ func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequ span.End() } }() - res = &payload.Search_Responses{ Responses: make([]*payload.Search_Response, len(reqs.GetRequests())), } var wg sync.WaitGroup - var mu sync.Mutex + var mu, emu sync.Mutex rids := make([]string, 0, len(reqs.GetRequests())) - for i, req := range reqs.Requests { + for i, req := range reqs.GetRequests() { idx, query := i, req rids = append(rids, req.GetConfig().GetRequestId()) - vl := len(req.GetVector()) - if vl < algorithm.MinimumVectorDimensionSize { - err := errors.ErrInvalidDimensionSize(vl, 0) - err = status.WrapWithInvalidArgument(vald.MultiSearchRPCName+" API invalid vector argument", err, - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.BadRequest{ - FieldViolations: []*errdetails.BadRequestFieldViolation{ - { - Field: "vector dimension size", - Description: err.Error(), - }, - }, - }, info.Get()) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.StatusCodeInvalidArgument(err.Error())...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err - } wg.Add(1) s.eg.Go(func() error { defer wg.Done() @@ -866,16 +904,18 @@ func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequ sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) sspan.SetStatus(trace.StatusError, err.Error()) } - mu.Lock() + emu.Lock() if errs == nil { errs = err } else { errs = errors.Wrap(errs, err.Error()) } - mu.Unlock() + emu.Unlock() return nil } + mu.Lock() res.Responses[idx] = r + mu.Unlock() return nil }) } @@ -895,7 +935,7 @@ func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequ span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } - return nil, err + return res, err } return res, nil } @@ -912,24 +952,23 @@ func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_Multi Responses: make([]*payload.Search_Response, len(reqs.GetRequests())), } var wg sync.WaitGroup - var mu sync.Mutex + var mu, emu sync.Mutex rids := make([]string, 0, len(reqs.GetRequests())) - for i, req := range reqs.Requests { + for i, req := range reqs.GetRequests() { idx, query := i, req rids = append(rids, req.GetConfig().GetRequestId()) wg.Add(1) s.eg.Go(func() error { - sctx, sspan := trace.StartSpan(ctx, apiName+"."+vald.MultiSearchByIDRPCName+"/errgroup.Go/id-"+strconv.Itoa(idx)) + defer wg.Done() + ctx, sspan := trace.StartSpan(ctx, apiName+"."+vald.MultiSearchByIDRPCName+"/errgroup.Go/id-"+strconv.Itoa(idx)) defer func() { - if span != nil { - span.End() + if sspan != nil { + sspan.End() } }() - defer wg.Done() - r, err := s.SearchByID(sctx, query) + r, err := s.SearchByID(ctx, query) if err != nil { - st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.SearchByIDRPCName+" gRPC error response", + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.SearchByIDRPCName+" gRPC error response", &errdetails.RequestInfo{ RequestId: query.GetConfig().GetRequestId(), ServingData: errdetails.Serialize(query), @@ -939,23 +978,24 @@ func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_Multi sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) sspan.SetStatus(trace.StatusError, err.Error()) } - mu.Lock() + emu.Lock() if errs == nil { errs = err } else { errs = errors.Wrap(errs, err.Error()) } - mu.Unlock() + emu.Unlock() return nil } + mu.Lock() res.Responses[idx] = r + mu.Unlock() return nil }) } wg.Wait() if errs != nil { - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.MultiSearchByIDRPCName+" gRPC error response", + st, msg, err := status.ParseError(errs, codes.Internal, "failed to parse "+vald.MultiSearchByIDRPCName+" gRPC error response", &errdetails.RequestInfo{ RequestId: strings.Join(rids, ","), ServingData: errdetails.Serialize(reqs), @@ -969,7 +1009,7 @@ func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_Multi span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } - return nil, err + return res, err } return res, nil } @@ -1048,13 +1088,18 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq span.End() } }() + + uuid := req.GetId() + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.LinearSearchByIDRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } if len(req.GetId()) == 0 { err = errors.ErrInvalidMetaDataConfig - err = status.WrapWithInvalidArgument(vald.LinearSearchByIDRPCName+" API invalid uuid", err, - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - ServingData: errdetails.Serialize(req), - }, + err = status.WrapWithInvalidArgument(vald.LinearSearchByIDRPCName+" API invalid uuid", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -1070,13 +1115,7 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq } return nil, err } - oreq := &payload.Object_VectorRequest{ - Id: &payload.Object_ID{ - Id: req.GetId(), - }, - Filters: req.GetConfig().GetEgressFilters(), - } - vec, err := s.GetObject(ctx, oreq) + vec, err := s.getObject(ctx, uuid) cfg := req.GetConfig() mn := cfg.GetMinNum() if req.Config != nil { @@ -1091,15 +1130,54 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq EgressFilters: cfg.GetEgressFilters(), } if err != nil { - _, _, err := status.ParseError(err, codes.NotFound, fmt.Sprintf(vald.LinearSearchByIDRPCName+" API failed to get uuid %s's object", req.GetId()), - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - ServingData: errdetails.Serialize(oreq), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.LinearSearchByIDRPCName + "." + vald.GetObjectRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }) + var ( + attrs trace.Attributes + st *status.Status + msg string + ) + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument( + vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API invalid argument for uuid \""+uuid+"\" detected", + err, + reqInfo, + resInfo, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)), errors.Is(err, errors.ErrObjectNotFound(nil, uuid)): + err = nil + default: + st, msg, err = status.ParseError(err, codes.Unknown, vald.GetObjectRPCName+" API for "+vald.SearchByIDRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) + if st == nil || st.Code() == codes.NotFound { + err = nil + } + } + if err != nil { + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } var serr error res, serr = s.doSearch(ctx, scfg, func(ctx context.Context, vc vald.Client, copts ...grpc.CallOption) (*payload.Search_Response, error) { return vc.LinearSearchByID(ctx, req, copts...) @@ -1108,14 +1186,7 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq return res, nil } err = errors.Wrap(err, serr.Error()) - st, msg, serr := status.ParseError(err, codes.Internal, vald.LinearSearchByIDRPCName+" API failed to process search request", - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.LinearSearchByIDRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }) + st, msg, serr = status.ParseError(err, codes.Internal, vald.LinearSearchByIDRPCName+" API failed to process search request", reqInfo, resInfo) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -1129,14 +1200,7 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq Config: scfg, }) if err != nil { - _, _, err := status.ParseError(err, codes.Internal, vald.LinearSearchByIDRPCName+" API failed to process search request", - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.LinearSearchByIDRPCName + "." + vald.LinearSearchRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) + _, _, err := status.ParseError(err, codes.Internal, vald.LinearSearchByIDRPCName+" API failed to process search request", reqInfo, resInfo, info.Get()) var serr error res, serr = s.doSearch(ctx, scfg, func(ctx context.Context, vc vald.Client, copts ...grpc.CallOption) (*payload.Search_Response, error) { return vc.LinearSearchByID(ctx, req, copts...) @@ -1144,14 +1208,7 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq if serr == nil { return res, nil } - st, msg, serr := status.ParseError(serr, codes.Internal, vald.LinearSearchByIDRPCName+" API failed to process search request", - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.LinearSearchByIDRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }) + st, msg, serr := status.ParseError(serr, codes.Internal, vald.LinearSearchByIDRPCName+" API failed to process search request", reqInfo, resInfo) err = errors.Wrap(err, serr.Error()) if span != nil { span.RecordError(err) @@ -1272,39 +1329,15 @@ func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_Mul span.End() } }() - res = &payload.Search_Responses{ Responses: make([]*payload.Search_Response, len(reqs.GetRequests())), } var wg sync.WaitGroup - var mu sync.Mutex + var mu, emu sync.Mutex rids := make([]string, 0, len(reqs.GetRequests())) - for i, req := range reqs.Requests { + for i, req := range reqs.GetRequests() { idx, query := i, req rids = append(rids, req.GetConfig().GetRequestId()) - vl := len(req.GetVector()) - if vl < algorithm.MinimumVectorDimensionSize { - err := errors.ErrInvalidDimensionSize(vl, 0) - err = status.WrapWithInvalidArgument(vald.MultiLinearSearchRPCName+" API invalid vector argument", err, - &errdetails.RequestInfo{ - RequestId: req.GetConfig().GetRequestId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.BadRequest{ - FieldViolations: []*errdetails.BadRequestFieldViolation{ - { - Field: "vector dimension size", - Description: err.Error(), - }, - }, - }, info.Get()) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.StatusCodeInvalidArgument(err.Error())...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err - } wg.Add(1) s.eg.Go(func() error { defer wg.Done() @@ -1316,7 +1349,7 @@ func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_Mul }() r, err := s.LinearSearch(ctx, query) if err != nil { - st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.LinearSearchRPCName+" gRPC error response", + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.SearchRPCName+" gRPC error response", &errdetails.RequestInfo{ RequestId: query.GetConfig().GetRequestId(), ServingData: errdetails.Serialize(query), @@ -1326,16 +1359,18 @@ func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_Mul sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) sspan.SetStatus(trace.StatusError, err.Error()) } - mu.Lock() + emu.Lock() if errs == nil { errs = err } else { errs = errors.Wrap(errs, err.Error()) } - mu.Unlock() + emu.Unlock() return nil } + mu.Lock() res.Responses[idx] = r + mu.Unlock() return nil }) } @@ -1355,7 +1390,7 @@ func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_Mul span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } - return nil, err + return res, err } return res, nil } @@ -1372,24 +1407,23 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search Responses: make([]*payload.Search_Response, len(reqs.GetRequests())), } var wg sync.WaitGroup - var mu sync.Mutex + var mu, emu sync.Mutex rids := make([]string, 0, len(reqs.GetRequests())) - for i, req := range reqs.Requests { + for i, req := range reqs.GetRequests() { idx, query := i, req rids = append(rids, req.GetConfig().GetRequestId()) wg.Add(1) s.eg.Go(func() error { + defer wg.Done() ctx, sspan := trace.StartSpan(ctx, apiName+"."+vald.MultiLinearSearchByIDRPCName+"/errgroup.Go/id-"+strconv.Itoa(idx)) defer func() { if sspan != nil { sspan.End() } }() - defer wg.Done() r, err := s.LinearSearchByID(ctx, query) if err != nil { - st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.LinearSearchByIDRPCName+" gRPC error response", + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.SearchByIDRPCName+" gRPC error response", &errdetails.RequestInfo{ RequestId: query.GetConfig().GetRequestId(), ServingData: errdetails.Serialize(query), @@ -1399,23 +1433,24 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) sspan.SetStatus(trace.StatusError, err.Error()) } - mu.Lock() + emu.Lock() if errs == nil { errs = err } else { errs = errors.Wrap(errs, err.Error()) } - mu.Unlock() + emu.Unlock() return nil } + mu.Lock() res.Responses[idx] = r + mu.Unlock() return nil }) } wg.Wait() if errs != nil { - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.MultiLinearSearchByIDRPCName+" gRPC error response", + st, msg, err := status.ParseError(errs, codes.Internal, "failed to parse "+vald.MultiLinearSearchByIDRPCName+" gRPC error response", &errdetails.RequestInfo{ RequestId: strings.Join(rids, ","), ServingData: errdetails.Serialize(reqs), @@ -1429,7 +1464,7 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } - return nil, err + return res, err } return res, nil } @@ -1442,12 +1477,17 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (ce *p } }() uuid := req.GetVector().GetId() + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } if len(uuid) == 0 { err = errors.ErrInvalidMetaDataConfig - err = status.WrapWithInvalidArgument(vald.InsertRPCName+" API invalid uuid", err, - &errdetails.RequestInfo{ - ServingData: errdetails.Serialize(req), - }, + err = status.WrapWithInvalidArgument(vald.InsertRPCName+" API invalid uuid", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -1455,10 +1495,6 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (ce *p Description: err.Error(), }, }, - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) if span != nil { span.RecordError(err) @@ -1471,11 +1507,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (ce *p vl := len(vec) if vl < algorithm.MinimumVectorDimensionSize { err = errors.ErrInvalidDimensionSize(vl, 0) - err = status.WrapWithInvalidArgument(vald.InsertRPCName+" API invalid vector argument", err, - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(req), - }, + err = status.WrapWithInvalidArgument(vald.InsertRPCName+" API invalid vector argument", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -1492,26 +1524,30 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (ce *p return nil, err } if !req.GetConfig().GetSkipStrictExistCheck() { - id, err := s.Exists(ctx, &payload.Object_ID{ - Id: uuid, - }) - if err == nil && id != nil && len(id.GetId()) != 0 { - if err == nil { - err = errors.ErrMetaDataAlreadyExists(uuid) - } - st, msg, err := status.ParseError(err, codes.AlreadyExists, - "error "+vald.InsertRPCName+" API ID = "+uuid+" already exists", - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + "." + vald.ExistsRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) + id, err := s.exists(ctx, uuid) + var attrs trace.Attributes + if err != nil { + switch { + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.ExistsRPCName+" API for "+vald.InsertRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.ExistsRPCName+" API for "+vald.InsertRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.ExistsRPCName+" API for "+vald.InsertRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + err = nil + } + } else if id != nil && len(id.GetId()) != 0 { + err = status.WrapWithAlreadyExists(vald.InsertRPCName+" API uuid "+uuid+"'s data already exists", errors.ErrMetaDataAlreadyExists(uuid), reqInfo, resInfo, info.Get()) + attrs = trace.StatusCodeAlreadyExists(err.Error()) + } + if err != nil { if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(attrs...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err @@ -1607,6 +1643,23 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (ce *p return nil }) if err != nil { + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal(vald.InsertRPCName+" API connection not found", err, + &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + ".DoMulti", + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } if errs == nil { errs = err } else { @@ -1699,13 +1752,17 @@ func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequ uuid := req.GetVector().GetId() vector := req.GetVector().GetVector() vl := len(vector) + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(reqs), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiInsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } if vl < algorithm.MinimumVectorDimensionSize { err = errors.ErrInvalidDimensionSize(vl, 0) - err = status.WrapWithInvalidArgument(vald.MultiInsertRPCName+" API invalid vector argument", err, - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(reqs), - }, + err = status.WrapWithInvalidArgument(vald.MultiInsertRPCName+" API invalid vector argument", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -1722,26 +1779,30 @@ func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequ return nil, err } if !req.GetConfig().GetSkipStrictExistCheck() { - id, err := s.Exists(ctx, &payload.Object_ID{ - Id: uuid, - }) - if err == nil && id != nil && len(id.GetId()) != 0 { - if err == nil { - err = errors.ErrMetaDataAlreadyExists(uuid) - } - st, msg, err := status.ParseError(err, codes.AlreadyExists, - "error "+vald.MultiInsertRPCName+" API ID = "+uuid+" already exists", - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiInsertRPCName + "." + vald.ExistsRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) + id, err := s.exists(ctx, uuid) + var attrs trace.Attributes + if err != nil { + switch { + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.ExistsRPCName+" API for "+vald.MultiInsertRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.ExistsRPCName+" API for "+vald.MultiInsertRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.ExistsRPCName+" API for "+vald.MultiInsertRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + err = nil + } + } else if id != nil && len(id.GetId()) != 0 { + err = status.WrapWithAlreadyExists(vald.MultiInsertRPCName+" API uuid "+uuid+"'s data already exists", errors.ErrMetaDataAlreadyExists(uuid), reqInfo, resInfo, info.Get()) + attrs = trace.StatusCodeAlreadyExists(err.Error()) + } + if err != nil { if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(attrs...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err @@ -1837,6 +1898,24 @@ func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequ return nil }) if err != nil { + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal(vald.MultiInsertRPCName+" API connection not found", err, + &errdetails.RequestInfo{ + RequestId: strings.Join(ids, ", "), + ServingData: errdetails.Serialize(reqs), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiInsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + if errs == nil { errs = err } else { @@ -1873,12 +1952,17 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res * } }() uuid := req.GetVector().GetId() + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.GetObjectRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } if len(uuid) == 0 { err = errors.ErrInvalidMetaDataConfig - err = status.WrapWithInvalidArgument(vald.UpdateRPCName+" API invalid uuid", err, - &errdetails.RequestInfo{ - ServingData: errdetails.Serialize(req), - }, + err = status.WrapWithInvalidArgument(vald.UpdateRPCName+" API invalid uuid", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -1886,10 +1970,6 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res * Description: err.Error(), }, }, - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) if span != nil { span.RecordError(err) @@ -1902,11 +1982,7 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res * vl := len(vec) if vl < algorithm.MinimumVectorDimensionSize { err = errors.ErrInvalidDimensionSize(vl, 0) - err = status.WrapWithInvalidArgument(vald.UpdateRPCName+" API invalid vector argument", err, - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(req), - }, + err = status.WrapWithInvalidArgument(vald.UpdateRPCName+" API invalid vector argument", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -1924,28 +2000,54 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res * } if !req.GetConfig().GetSkipStrictExistCheck() { - vec, err := s.GetObject(ctx, &payload.Object_VectorRequest{ - Id: &payload.Object_ID{ - Id: uuid, - }, - }) - if err != nil || vec == nil || len(vec.GetId()) == 0 { - if err == nil { - err = errors.ErrObjectIDNotFound(uuid) + vec, err := s.getObject(ctx, uuid) + if err != nil || vec == nil { + var ( + attrs trace.Attributes + st *status.Status + msg string + ) + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument( + vald.GetObjectRPCName+" API for "+vald.UpdateRPCName+" API invalid argument for uuid \""+uuid+"\" detected", + err, + reqInfo, + resInfo, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.GetObjectRPCName+" API for "+vald.UpdateRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.GetObjectRPCName+" API for "+vald.UpdateRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.GetObjectRPCName+" API for "+vald.UpdateRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)), errors.Is(err, errors.ErrObjectNotFound(nil, uuid)): + err = status.WrapWithNotFound(vald.GetObjectRPCName+" API for "+vald.UpdateRPCName+" API uuid "+uuid+"'s object not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeNotFound(err.Error()) + default: + code := codes.Unknown + if err == nil { + err = errors.ErrObjectIDNotFound(uuid) + code = codes.NotFound + } + st, msg, err = status.ParseError(err, code, vald.GetObjectRPCName+" API for "+vald.UpdateRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) } - st, msg, err := status.ParseError(err, codes.NotFound, - "error "+vald.UpdateRPCName+" API ID = "+uuid+" not found", - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.GetObjectRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(attrs...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err @@ -1995,6 +2097,24 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res * } res, err = s.Remove(ctx, rreq) if err != nil { + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal(vald.RemoveRPCName+" for "+vald.UpdateRPCName+" API connection not found", err, + &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(rreq), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.RemoveRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.RemoveRPCName+" for "+vald.UpdateRPCName+" gRPC error response", &errdetails.RequestInfo{ @@ -2023,6 +2143,23 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res * } res, err = s.Insert(ctx, ireq) if err != nil { + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal(vald.InsertRPCName+" for "+vald.UpdateRPCName+" API connection not found", err, + &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(ireq), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.InsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.InsertRPCName+" for "+vald.UpdateRPCName+" gRPC error response", &errdetails.RequestInfo{ @@ -2108,13 +2245,18 @@ func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequ now := time.Now().UnixNano() for _, req := range vecs { vl := len(req.GetVector().GetVector()) + uuid := req.GetVector().GetId() + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(reqs), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiUpdateRPCName + "." + vald.GetObjectRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } if vl < algorithm.MinimumVectorDimensionSize { err = errors.ErrInvalidDimensionSize(vl, 0) - err = status.WrapWithInvalidArgument(vald.MultiUpdateRPCName+" API invalid vector argument", err, - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(reqs), - }, + err = status.WrapWithInvalidArgument(vald.MultiUpdateRPCName+" API invalid vector argument", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -2130,30 +2272,50 @@ func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequ } return nil, err } - uuid := req.GetVector().GetId() if !req.GetConfig().GetSkipStrictExistCheck() { - vec, err := s.GetObject(ctx, &payload.Object_VectorRequest{ - Id: &payload.Object_ID{ - Id: uuid, - }, - }) - if err != nil || vec == nil || len(vec.GetId()) == 0 { - if err == nil { - err = errors.ErrObjectIDNotFound(uuid) + vec, err := s.getObject(ctx, uuid) + if err != nil || vec == nil { + var ( + attrs trace.Attributes + st *status.Status + msg string + ) + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument( + vald.GetObjectRPCName+" API for "+vald.MultiUpdateRPCName+" API invalid argument for uuid \""+uuid+"\" detected", + err, + reqInfo, + resInfo, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.GetObjectRPCName+" API for "+vald.MultiUpdateRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.GetObjectRPCName+" API for "+vald.MultiUpdateRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.GetObjectRPCName+" API for "+vald.MultiUpdateRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)), errors.Is(err, errors.ErrObjectNotFound(nil, uuid)): + err = status.WrapWithNotFound(vald.GetObjectRPCName+" API for "+vald.MultiUpdateRPCName+" API uuid "+uuid+"'s object not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeNotFound(err.Error()) + default: + st, msg, err = status.ParseError(err, codes.Unknown, vald.GetObjectRPCName+" API for "+vald.MultiUpdateRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) } - st, msg, err := status.ParseError(err, codes.NotFound, - "error "+vald.MultiUpdateRPCName+" API ID = "+uuid+" not fount", - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(reqs), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiUpdateRPCName + "." + vald.GetObjectRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(attrs...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err @@ -2250,12 +2412,16 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * vec := req.GetVector() uuid := vec.GetId() + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } if len(uuid) == 0 { - err = errors.ErrInvalidMetaDataConfig - err = status.WrapWithInvalidArgument(vald.UpsertRPCName+" API invalid uuid", err, - &errdetails.RequestInfo{ - ServingData: errdetails.Serialize(req), - }, + err = status.WrapWithInvalidArgument(vald.UpsertRPCName+" API invalid uuid", errors.ErrInvalidMetaDataConfig, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -2263,10 +2429,6 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * Description: err.Error(), }, }, - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) if span != nil { span.RecordError(err) @@ -2279,11 +2441,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * vl := len(vec.GetVector()) if vl < algorithm.MinimumVectorDimensionSize { err = errors.ErrInvalidDimensionSize(vl, 0) - err = status.WrapWithInvalidArgument(vald.UpsertRPCName+" API invalid vector argument", err, - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(req), - }, + err = status.WrapWithInvalidArgument(vald.UpsertRPCName+" API invalid vector argument", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -2301,38 +2459,89 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * } var shouldInsert bool if !req.GetConfig().GetSkipStrictExistCheck() { - vec, err := s.GetObject(ctx, &payload.Object_VectorRequest{ - Id: &payload.Object_ID{ - Id: uuid, - }, - }) - if err != nil || vec == nil || len(vec.GetId()) == 0 { - shouldInsert = true - } else if conv.F32stos(vec.GetVector()) == conv.F32stos(req.GetVector().GetVector()) { - if err == nil { - err = errors.ErrSameVectorAlreadyExists(uuid, vec.GetVector(), req.GetVector().GetVector()) + vec, err := s.getObject(ctx, uuid) + var ( + attrs trace.Attributes + st *status.Status + msg string + ) + if err != nil || vec == nil { + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument( + vald.GetObjectRPCName+" API for "+vald.UpsertRPCName+" API invalid argument for uuid \""+uuid+"\" detected", + err, + reqInfo, + resInfo, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.GetObjectRPCName+" API for "+vald.UpsertRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.GetObjectRPCName+" API for "+vald.UpsertRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.GetObjectRPCName+" API for "+vald.UpsertRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)), errors.Is(err, errors.ErrObjectNotFound(nil, uuid)): + err = nil + shouldInsert = true + default: + st, msg, err = status.ParseError(err, codes.Unknown, vald.GetObjectRPCName+" API for "+vald.UpsertRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) + if st != nil && st.Code() == codes.NotFound { + err = nil + shouldInsert = true + } } - st, msg, err := status.ParseError(err, codes.AlreadyExists, - "error "+vald.UpdateRPCName+" for "+vald.UpsertRPCName+" API ID = "+uuid+"'s same vector data already exists", - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + "." + vald.GetObjectRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) + } else if conv.F32stos(vec.GetVector()) == conv.F32stos(req.GetVector().GetVector()) { + err = status.WrapWithAlreadyExists(vald.GetObjectRPCName+" API for "+vald.UpsertRPCName+" API ID = "+uuid+"'s same vector data already exists", errors.ErrSameVectorAlreadyExists(uuid, vec.GetVector(), req.GetVector().GetVector()), reqInfo, resInfo) + attrs = trace.StatusCodeAlreadyExists(err.Error()) + } + if err != nil { if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(attrs...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err } + } else { - id, err := s.Exists(ctx, &payload.Object_ID{ - Id: uuid, - }) + id, err := s.exists(ctx, uuid) + if err != nil { + var attrs trace.Attributes + switch { + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.ExistsRPCName+" API for "+vald.UpsertRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.ExistsRPCName+" API for "+vald.UpsertRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.ExistsRPCName+" API for "+vald.UpsertRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + err = nil + } + if err != nil { + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + } shouldInsert = err != nil || id == nil || len(id.GetId()) == 0 } @@ -2440,19 +2649,22 @@ func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequ insertReqs := make([]*payload.Insert_Request, 0, len(reqs.GetRequests())) updateReqs := make([]*payload.Update_Request, 0, len(reqs.GetRequests())) - ids := make([]string, 0, len(reqs.GetRequests())) for _, req := range reqs.GetRequests() { vec := req.GetVector() uuid := vec.GetId() + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiUpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } vl := len(vec.GetVector()) if vl < algorithm.MinimumVectorDimensionSize { err = errors.ErrInvalidDimensionSize(vl, 0) - err = status.WrapWithInvalidArgument(vald.MultiUpsertRPCName+" API invalid vector argument", err, - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(req), - }, + err = status.WrapWithInvalidArgument(vald.MultiUpsertRPCName+" API invalid vector argument", err, reqInfo, resInfo, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -2470,20 +2682,90 @@ func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequ } var shouldInsert bool if !req.GetConfig().GetSkipStrictExistCheck() { - vec, err := s.GetObject(ctx, &payload.Object_VectorRequest{ - Id: &payload.Object_ID{ - Id: uuid, - }, - }) - if err != nil || vec == nil || len(vec.GetId()) == 0 { - shouldInsert = true + vec, err := s.getObject(ctx, uuid) + if err != nil || vec == nil { + var ( + attrs trace.Attributes + st *status.Status + msg string + ) + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument( + vald.GetObjectRPCName+" API for "+vald.MultiUpsertRPCName+" API invalid argument for uuid \""+uuid+"\" detected", + err, + reqInfo, + resInfo, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.GetObjectRPCName+" API for "+vald.MultiUpsertRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.GetObjectRPCName+" API for "+vald.MultiUpsertRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.GetObjectRPCName+" API for "+vald.MultiUpsertRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)), errors.Is(err, errors.ErrObjectNotFound(nil, uuid)): + err = nil + shouldInsert = true + default: + st, msg, err = status.ParseError(err, codes.Unknown, vald.GetObjectRPCName+" API for "+vald.MultiUpsertRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) + if st != nil && st.Code() == codes.NotFound { + err = nil + shouldInsert = true + } + } + if err != nil { + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } } else if conv.F32stos(vec.GetVector()) == conv.F32stos(req.GetVector().GetVector()) { + err = status.WrapWithAlreadyExists(vald.GetObjectRPCName+" API for "+vald.MultiUpsertRPCName+" API ID = "+uuid+"'s same vector data already exists", errors.ErrSameVectorAlreadyExists(uuid, vec.GetVector(), req.GetVector().GetVector()), reqInfo, resInfo) + log.Warn(err) continue } } else { - id, err := s.Exists(ctx, &payload.Object_ID{ - Id: uuid, - }) + id, err := s.exists(ctx, uuid) + if err != nil { + var attrs trace.Attributes + switch { + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.ExistsRPCName+" API for "+vald.MultiUpsertRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.ExistsRPCName+" API for "+vald.MultiUpsertRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.ExistsRPCName+" API for "+vald.MultiUpsertRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + err = nil + } + if err != nil { + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + } + shouldInsert = err != nil || id == nil || len(id.GetId()) == 0 } ids = append(ids, uuid) @@ -2581,16 +2863,15 @@ func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequ } if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(reqs), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiUpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.MultiUpsertRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: strings.Join(ids, ","), - ServingData: errdetails.Serialize(reqs), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiUpsertRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) + "failed to parse "+vald.MultiUpsertRPCName+" gRPC error response", reqInfo, resInfo, info.Get()) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -2610,28 +2891,64 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (locs }() id := req.GetId() + uuid := id.GetId() + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } if !req.GetConfig().GetSkipStrictExistCheck() { - id, err := s.Exists(ctx, id) - if err != nil || id == nil || len(id.GetId()) == 0 { - if err == nil { - err = errors.ErrObjectIDNotFound(id.GetId()) + _, err := s.exists(ctx, uuid) + if err != nil { + var attrs trace.Attributes + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument( + vald.ExistsRPCName+" API for "+vald.RemoveRPCName+" API invalid argument for uuid \""+uuid+"\" detected", + err, + reqInfo, + resInfo, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)): + err = status.WrapWithNotFound(vald.ExistsRPCName+" API for "+vald.RemoveRPCName+" API id "+uuid+"'s data not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeNotFound(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.ExistsRPCName+" API for "+vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.ExistsRPCName+" API for "+vald.RemoveRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.ExistsRPCName+" API for "+vald.RemoveRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Unknown, vald.ExistsRPCName+" API for "+vald.RemoveRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) } - st, msg, err := status.ParseError(err, codes.NotFound, - "error "+vald.RemoveRPCName+" API ID = "+id.GetId()+" not found", - &errdetails.RequestInfo{ - RequestId: id.GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + "." + vald.ExistsRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) + if err != nil { + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err } - return nil, err } if req.GetConfig() != nil { req.GetConfig().SkipStrictExistCheck = true @@ -2664,15 +2981,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (locs loc, err := vc.Remove(ctx, req, copts...) if err != nil { st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: id.GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }) + "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -2692,15 +3001,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (locs }) if err != nil { st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: id.GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) + "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, info.Get()) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -2710,15 +3011,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (locs } if len(locs.Ips) <= 0 { err = errors.ErrIndexNotFound - err = status.WrapWithNotFound(vald.RemoveRPCName+" API remove target not found", err, - &errdetails.RequestInfo{ - RequestId: id.GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }) + err = status.WrapWithNotFound(vald.RemoveRPCName+" API remove target not found", err, reqInfo, resInfo) if span != nil { span.RecordError(err) span.SetAttributes(trace.StatusCodeNotFound(err.Error())...) @@ -2791,29 +3084,65 @@ func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequ ids := make([]string, 0, len(reqs.GetRequests())) for i, req := range reqs.GetRequests() { id := req.GetId() - ids = append(ids, id.GetId()) + uuid := id.GetId() + ids = append(ids, uuid) + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiRemoveRPCName + "." + vald.ExistsRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } if !req.GetConfig().GetSkipStrictExistCheck() { - sid, err := s.Exists(ctx, id) - if err != nil || sid == nil || len(sid.GetId()) == 0 { - if err == nil { - err = errors.ErrObjectIDNotFound(id.GetId()) + _, err = s.exists(ctx, uuid) + if err != nil { + var attrs trace.Attributes + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument( + vald.ExistsRPCName+" API for "+vald.MultiRemoveRPCName+" API invalid argument for uuid \""+uuid+"\" detected", + err, + reqInfo, + resInfo, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)): + err = status.WrapWithNotFound(vald.ExistsRPCName+" API for "+vald.MultiRemoveRPCName+" API id "+uuid+"'s data not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeNotFound(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.ExistsRPCName+" API for "+vald.MultiRemoveRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.ExistsRPCName+" API for "+vald.MultiRemoveRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.ExistsRPCName+" API for "+vald.MultiRemoveRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Unknown, vald.ExistsRPCName+" API for "+vald.MultiRemoveRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) } - st, msg, err := status.ParseError(err, codes.NotFound, - fmt.Sprintf(vald.MultiRemoveRPCName+" API ID = %v not found", id.GetId()), - &errdetails.RequestInfo{ - RequestId: id.GetId(), - ServingData: errdetails.Serialize(reqs), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiRemoveRPCName + "." + vald.ExistsRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) + if err != nil { + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err } - return nil, err } if reqs.GetRequests()[i].GetConfig() != nil { reqs.GetRequests()[i].GetConfig().SkipStrictExistCheck = true @@ -2935,8 +3264,8 @@ func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequ return location.ReStructure(ids, locs), nil } -func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) { - ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName) +func (s *server) getObject(ctx context.Context, uuid string) (vec *payload.Object_Vector, err error) { + ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.GetObjectRPCName+"/getObject") defer func() { if span != nil { span.End() @@ -2944,11 +3273,11 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques }() vch := make(chan *payload.Object_Vector, 1) ech := make(chan error, 1) + doneErr := errors.New("done getObject") + ctx, cancel := context.WithCancelCause(ctx) s.eg.Go(func() error { defer close(vch) defer close(ech) - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) var once sync.Once ech <- s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.Client, copts ...grpc.CallOption) error { sctx, sspan := trace.StartSpan(ctx, apiName+"."+vald.GetObjectRPCName+"/"+target) @@ -2957,49 +3286,49 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques sspan.End() } }() + req := &payload.Object_VectorRequest{ + Id: &payload.Object_ID{ + Id: uuid, + }, + } ovec, err := vc.GetObject(sctx, req, copts...) if err != nil { + var ( + attrs trace.Attributes + st *status.Status + msg string + ) switch { case errors.Is(err, context.Canceled), errors.Is(err, errors.ErrRPCCallFailed(target, context.Canceled)): - if sspan != nil { - sspan.RecordError(err) - sspan.SetAttributes(trace.StatusCodeCancelled( - errdetails.ValdGRPCResourceTypePrefix + - "/vald.v1." + vald.GetObjectRPCName + ".BroadCast/" + - target + " canceled: " + err.Error())...) - sspan.SetStatus(trace.StatusError, err.Error()) - } - return nil + attrs = trace.StatusCodeCancelled( + errdetails.ValdGRPCResourceTypePrefix + + "/vald.v1." + vald.GetObjectRPCName + ".BroadCast/" + + target + " canceled: " + err.Error()) case errors.Is(err, context.DeadlineExceeded), errors.Is(err, errors.ErrRPCCallFailed(target, context.DeadlineExceeded)): - if sspan != nil { - sspan.RecordError(err) - sspan.SetAttributes(trace.StatusCodeDeadlineExceeded( - errdetails.ValdGRPCResourceTypePrefix + - "/vald.v1." + vald.GetObjectRPCName + ".BroadCast/" + - target + " deadline_exceeded: " + err.Error())...) - sspan.SetStatus(trace.StatusError, err.Error()) - } - return nil + attrs = trace.StatusCodeDeadlineExceeded( + errdetails.ValdGRPCResourceTypePrefix + + "/vald.v1." + vald.GetObjectRPCName + ".BroadCast/" + + target + " deadline_exceeded: " + err.Error()) + default: + st, msg, err = status.ParseError(err, codes.NotFound, "error "+vald.GetObjectRPCName+" API meta "+uuid+"'s uuid not found", + &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }) + attrs = trace.FromGRPCStatus(st.Code(), msg) } - uuid := req.GetId().GetId() - st, msg, err := status.ParseError(err, codes.NotFound, - vald.GetObjectRPCName+" API ID = "+uuid+"'s not found", - &errdetails.RequestInfo{ - RequestId: uuid, - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }, info.Get()) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(attrs...) + sspan.SetStatus(trace.StatusError, err.Error()) } - if err != nil && st.Code() != codes.NotFound { + if err != nil && st != nil && st.Code() != codes.NotFound { return err } return nil @@ -3007,7 +3336,7 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques if ovec != nil && ovec.GetId() != "" && ovec.GetVector() != nil { once.Do(func() { vch <- ovec - cancel() + cancel(doneErr) }) } return nil @@ -3017,31 +3346,101 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques select { case <-ctx.Done(): err = ctx.Err() + if errors.Is(err, context.Canceled) && errors.Is(context.Cause(ctx), doneErr) { + select { + case vec = <-vch: + if vec == nil || vec.GetId() == "" || vec.GetVector() == nil { + err = errors.ErrObjectNotFound(nil, uuid) + } else { + err = nil + } + default: + } + } case vec = <-vch: + if vec == nil || vec.GetId() == "" || vec.GetVector() == nil { + err = errors.ErrObjectNotFound(nil, uuid) + } case err = <-ech: } - if err != nil || vec == nil || vec.GetId() == "" || vec.GetVector() == nil { - err = errors.ErrObjectNotFound(err, req.GetId().GetId()) - st, msg, err := status.ParseError(err, codes.NotFound, - "failed to parse "+vald.GetObjectRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), - }, info.Get()) + if err != nil { if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(trace.StatusCodeNotFound(err.Error())...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err } + if vec == nil || vec.GetId() == "" || vec.GetVector() == nil { + return nil, errors.ErrObjectNotFound(nil, uuid) + } return vec, nil } +func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName) + defer func() { + if span != nil { + span.End() + } + }() + uuid := req.GetId().GetId() + vec, err = s.getObject(ctx, uuid) + if err == nil { + if vec != nil && vec.GetId() != "" && vec.GetVector() != nil { + return vec, nil + } + err = errors.ErrObjectNotFound(nil, uuid) + } + reqInfo := &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } + var attrs trace.Attributes + switch { + case errors.Is(err, errors.ErrInvalidUUID(uuid)): + err = status.WrapWithInvalidArgument(vald.GetObjectRPCName+" API invalid argument for uuid \""+uuid+"\" detected", err, reqInfo, resInfo, &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + case errors.Is(err, errors.ErrObjectIDNotFound(uuid)), errors.Is(err, errors.ErrObjectNotFound(nil, uuid)): + err = status.WrapWithNotFound(vald.GetObjectRPCName+" API id "+uuid+"'s object not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeNotFound(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.GetObjectRPCName+" API connection not found", err, reqInfo, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.GetObjectRPCName+" API canceled", err, reqInfo, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.GetObjectRPCName+" API deadline exceeded", err, reqInfo, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Unknown, vald.GetObjectRPCName+" API uuid "+uuid+"'s request returned error", reqInfo, resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Debug(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err +} + func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err error) { ctx, span := trace.StartSpan(stream.Context(), apiName+"/"+vald.StreamGetObjectRPCName) defer func() { diff --git a/pkg/gateway/lb/handler/grpc/handler_test.go b/pkg/gateway/lb/handler/grpc/handler_test.go index 63db7d59d3..bbccfb2b1e 100644 --- a/pkg/gateway/lb/handler/grpc/handler_test.go +++ b/pkg/gateway/lb/handler/grpc/handler_test.go @@ -3185,3 +3185,269 @@ func Test_server_MultiLinearSearchByID(t *testing.T) { }) } } + +func Test_server_exists(t *testing.T) { + type args struct { + ctx context.Context + uuid string + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + timeout time.Duration + replica int + streamConcurrency int + name string + ip string + UnimplementedValdServer vald.UnimplementedValdServer + } + type want struct { + wantId *payload.Object_ID + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_ID, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotId *payload.Object_ID, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + if !reflect.DeepEqual(gotId, w.wantId) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotId, w.wantId) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx: nil, + uuid: "", + }, + fields: fields { + eg: nil, + gateway: nil, + timeout: nil, + replica: 0, + streamConcurrency: 0, + name: "", + ip: "", + UnimplementedValdServer: nil, + }, + want: want{}, + checkFunc: defaultCheckFunc, + beforeFunc: func(t *testing.T, args args) { + t.Helper() + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + }, + }, + */ + + // TODO test cases + /* + func() test { + return test { + name: "test_case_2", + args: args { + ctx: nil, + uuid: "", + }, + fields: fields { + eg: nil, + gateway: nil, + timeout: nil, + replica: 0, + streamConcurrency: 0, + name: "", + ip: "", + UnimplementedValdServer: nil, + }, + want: want{}, + checkFunc: defaultCheckFunc, + beforeFunc: func(t *testing.T, args args) { + t.Helper() + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + }, + } + }(), + */ + } + + for _, tc := range tests { + test := tc + t.Run(test.name, func(tt *testing.T) { + tt.Parallel() + defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) + if test.beforeFunc != nil { + test.beforeFunc(tt, test.args) + } + if test.afterFunc != nil { + defer test.afterFunc(tt, test.args) + } + checkFunc := test.checkFunc + if test.checkFunc == nil { + checkFunc = defaultCheckFunc + } + s := &server{ + eg: test.fields.eg, + gateway: test.fields.gateway, + timeout: test.fields.timeout, + replica: test.fields.replica, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServer: test.fields.UnimplementedValdServer, + } + + gotId, err := s.exists(test.args.ctx, test.args.uuid) + if err := checkFunc(test.want, gotId, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_getObject(t *testing.T) { + type args struct { + ctx context.Context + uuid string + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + timeout time.Duration + replica int + streamConcurrency int + name string + ip string + UnimplementedValdServer vald.UnimplementedValdServer + } + type want struct { + wantVec *payload.Object_Vector + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Vector, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotVec *payload.Object_Vector, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + if !reflect.DeepEqual(gotVec, w.wantVec) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotVec, w.wantVec) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx: nil, + uuid: "", + }, + fields: fields { + eg: nil, + gateway: nil, + timeout: nil, + replica: 0, + streamConcurrency: 0, + name: "", + ip: "", + UnimplementedValdServer: nil, + }, + want: want{}, + checkFunc: defaultCheckFunc, + beforeFunc: func(t *testing.T, args args) { + t.Helper() + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + }, + }, + */ + + // TODO test cases + /* + func() test { + return test { + name: "test_case_2", + args: args { + ctx: nil, + uuid: "", + }, + fields: fields { + eg: nil, + gateway: nil, + timeout: nil, + replica: 0, + streamConcurrency: 0, + name: "", + ip: "", + UnimplementedValdServer: nil, + }, + want: want{}, + checkFunc: defaultCheckFunc, + beforeFunc: func(t *testing.T, args args) { + t.Helper() + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + }, + } + }(), + */ + } + + for _, tc := range tests { + test := tc + t.Run(test.name, func(tt *testing.T) { + tt.Parallel() + defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) + if test.beforeFunc != nil { + test.beforeFunc(tt, test.args) + } + if test.afterFunc != nil { + defer test.afterFunc(tt, test.args) + } + checkFunc := test.checkFunc + if test.checkFunc == nil { + checkFunc = defaultCheckFunc + } + s := &server{ + eg: test.fields.eg, + gateway: test.fields.gateway, + timeout: test.fields.timeout, + replica: test.fields.replica, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServer: test.fields.UnimplementedValdServer, + } + + gotVec, err := s.getObject(test.args.ctx, test.args.uuid) + if err := checkFunc(test.want, gotVec, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} diff --git a/versions/GOLANGCILINT_VERSION b/versions/GOLANGCILINT_VERSION index 0bb2bc8f50..a612b67453 100644 --- a/versions/GOLANGCILINT_VERSION +++ b/versions/GOLANGCILINT_VERSION @@ -1 +1 @@ -v1.50.1 +v1.51.1 diff --git a/versions/GO_VERSION b/versions/GO_VERSION index 7a8a49471c..0fdd2359fd 100644 --- a/versions/GO_VERSION +++ b/versions/GO_VERSION @@ -1 +1 @@ -1.19.5 \ No newline at end of file +1.20 \ No newline at end of file diff --git a/versions/OPERATOR_SDK_VERSION b/versions/OPERATOR_SDK_VERSION index be048a24ac..5f8fab9ecd 100644 --- a/versions/OPERATOR_SDK_VERSION +++ b/versions/OPERATOR_SDK_VERSION @@ -1 +1 @@ -v1.26 +v1.27 diff --git a/versions/PROMETHEUS_STACK_VERSION b/versions/PROMETHEUS_STACK_VERSION index 9d12e2650b..a66343e174 100644 --- a/versions/PROMETHEUS_STACK_VERSION +++ b/versions/PROMETHEUS_STACK_VERSION @@ -1 +1 @@ -44.2.1 +44.3.1 diff --git a/versions/TELEPRESENCE_VERSION b/versions/TELEPRESENCE_VERSION index c0db09a443..1a285c3887 100644 --- a/versions/TELEPRESENCE_VERSION +++ b/versions/TELEPRESENCE_VERSION @@ -1 +1 @@ -2.10.4-rc.0 +2.10.5 diff --git a/versions/VALDCLI_VERSION b/versions/VALDCLI_VERSION index 78d19a2970..a20e2d82d2 100644 --- a/versions/VALDCLI_VERSION +++ b/versions/VALDCLI_VERSION @@ -1 +1 @@ -v1.6.3 +v1.7.0