@@ -163,15 +163,15 @@ func TestEndpointInfoByServicePort(t *testing.T) {
163
163
namespacedName types.NamespacedName
164
164
endpointSlices []* discovery.EndpointSlice
165
165
hostname string
166
- expectedMap map [ ServicePortName ] map [ string ] Endpoint
166
+ expectedMap spToEndpointMap
167
167
}{
168
168
"simple use case with 3 endpoints" : {
169
169
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
170
170
hostname : "host1" ,
171
171
endpointSlices : []* discovery.EndpointSlice {
172
172
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , []string {"host1" , "host2" }, []* int32 {utilpointer .Int32Ptr (80 )}),
173
173
},
174
- expectedMap : map [ ServicePortName ] map [ string ] Endpoint {
174
+ expectedMap : spToEndpointMap {
175
175
{NamespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" }, Port : "port-0" }: {
176
176
"10.0.1.1" : & BaseEndpointInfo {Endpoint : "10.0.1.1:80" , IsLocal : false },
177
177
"10.0.1.2" : & BaseEndpointInfo {Endpoint : "10.0.1.2:80" , IsLocal : true },
@@ -190,7 +190,7 @@ func TestEndpointInfoByServicePort(t *testing.T) {
190
190
191
191
got := esCache .endpointInfoByServicePort (tc .namespacedName )
192
192
if ! reflect .DeepEqual (got , tc .expectedMap ) {
193
- t .Errorf ("[%s] endpointInfoByServicePort does not match. Want: %v, Got: %v" , name , tc .expectedMap , got )
193
+ t .Errorf ("[%s] endpointInfoByServicePort does not match. Want: %+ v, Got: %+ v" , name , tc .expectedMap , got )
194
194
}
195
195
196
196
}
0 commit comments