@@ -207,16 +207,16 @@ type BpfServiceValue struct {
207207 LbPolicy string `json:"lbPolicy"`
208208 ServicePort prettyArray [uint32 ] `json:"servicePort,omitempty"`
209209 TargetPort prettyArray [uint32 ] `json:"targetPort,omitempty"`
210- WaypointAddr prettyArray [ byte ] `json:"waypointAddr,omitempty"`
210+ WaypointAddr string `json:"waypointAddr,omitempty"`
211211 WaypointPort uint32 `json:"waypointPort,omitempty"`
212212}
213213
214214type BpfBackendValue struct {
215- Ip prettyArray [ byte ] `json:"ip"`
216- ServiceCount uint32 `json:"serviceCount"`
217- Services []string `json:"services"`
218- WaypointAddr prettyArray [ byte ] `json:"waypointAddr,omitempty"`
219- WaypointPort uint32 `json:"waypointPort,omitempty"`
215+ Ip string `json:"ip"`
216+ ServiceCount uint32 `json:"serviceCount"`
217+ Services []string `json:"services"`
218+ WaypointAddr string `json:"waypointAddr,omitempty"`
219+ WaypointPort uint32 `json:"waypointPort,omitempty"`
220220}
221221
222222type BpfFrontendValue struct {
@@ -267,14 +267,12 @@ func (wd WorkloadBpfDump) WithBackends(backends []bpfcache.BackendValue) Workloa
267267 for _ , b := range backend .Ip {
268268 ip = append (ip , b )
269269 }
270- waypointAddr := [] byte {}
270+ waypointAddr := ""
271271 if backend .WaypointAddr != [16 ]byte {} {
272- for _ , b := range backend .WaypointAddr {
273- waypointAddr = append (waypointAddr , b )
274- }
272+ waypointAddr = nets .IpString (backend .WaypointAddr )
275273 }
276274 bac := BpfBackendValue {
277- Ip : ip ,
275+ Ip : nets . IpString ( backend . Ip ) ,
278276 ServiceCount : backend .ServiceCount ,
279277 WaypointAddr : waypointAddr ,
280278 WaypointPort : nets .ConvertPortToLittleEndian (backend .WaypointPort ),
@@ -285,7 +283,7 @@ func (wd WorkloadBpfDump) WithBackends(backends []bpfcache.BackendValue) Workloa
285283 if svc == "" {
286284 continue
287285 }
288- services = append (services , wd . hashName . NumToStr ( s ) )
286+ services = append (services , svc )
289287 }
290288 bac .Services = services
291289 converted = append (converted , bac )
@@ -319,11 +317,9 @@ func (wd WorkloadBpfDump) WithFrontends(frontends []bpfcache.FrontendValue) Work
319317func (wd WorkloadBpfDump ) WithServices (services []bpfcache.ServiceValue ) WorkloadBpfDump {
320318 converted := make ([]BpfServiceValue , 0 , len (services ))
321319 for _ , s := range services {
322- waypointAddr := [] byte {}
320+ waypointAddr := ""
323321 if s .WaypointAddr != [16 ]byte {} {
324- for _ , b := range s .WaypointAddr {
325- waypointAddr = append (waypointAddr , b )
326- }
322+ waypointAddr = nets .IpString (s .WaypointAddr )
327323 }
328324 svc := BpfServiceValue {
329325 EndpointCount : []uint32 {},
0 commit comments