@@ -98,7 +98,7 @@ type LogService struct {
98
98
//
99
99
}
100
100
101
- // IP to K8sResource MAp
101
+ // IP to K8sResource Map
102
102
var Ipcache sync.Map
103
103
104
104
// HealthCheck Function
@@ -883,9 +883,9 @@ func startIPInformers(ctx context.Context, wg *sync.WaitGroup) {
883
883
switch strings .ToUpper (kind ) {
884
884
885
885
case "POD" :
886
- resource = fmt .Sprintf ("%s.%s.pod " , name , namespace )
886
+ resource = fmt .Sprintf ("pod/%s/%s " , namespace , name )
887
887
case "SERVICE" :
888
- resource = fmt .Sprintf ("%s.%s.svc " , name , namespace )
888
+ resource = fmt .Sprintf ("svc/%s/%s " , namespace , name )
889
889
}
890
890
891
891
Ipcache .Store (ip , resource )
@@ -913,8 +913,8 @@ func startIPInformers(ctx context.Context, wg *sync.WaitGroup) {
913
913
if ! ok {
914
914
return
915
915
}
916
+ Ipcache .Delete (pod .Status .PodIP )
916
917
917
- updateIP ("POD" , pod .Namespace , pod .Name , "" )
918
918
},
919
919
})
920
920
@@ -945,7 +945,7 @@ func startIPInformers(ctx context.Context, wg *sync.WaitGroup) {
945
945
if ! ok {
946
946
return
947
947
}
948
- updateIP ( "SERVICE" , svc .Namespace , svc . Name , "" )
948
+ Ipcache . Delete ( svc .Spec . ClusterIP )
949
949
},
950
950
})
951
951
0 commit comments