Skip to content

Commit 3f0d02e

Browse files
committed
fix: Delete functionality
Signed-off-by: Harisudarsan <[email protected]>
1 parent 9a5a573 commit 3f0d02e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

relay-server/server/relayServer.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ type LogService struct {
9898
//
9999
}
100100

101-
// IP to K8sResource MAp
101+
// IP to K8sResource Map
102102
var Ipcache sync.Map
103103

104104
// HealthCheck Function
@@ -883,9 +883,9 @@ func startIPInformers(ctx context.Context, wg *sync.WaitGroup) {
883883
switch strings.ToUpper(kind) {
884884

885885
case "POD":
886-
resource = fmt.Sprintf("%s.%s.pod", name, namespace)
886+
resource = fmt.Sprintf("pod/%s/%s", namespace, name)
887887
case "SERVICE":
888-
resource = fmt.Sprintf("%s.%s.svc", name, namespace)
888+
resource = fmt.Sprintf("svc/%s/%s", namespace, name)
889889
}
890890

891891
Ipcache.Store(ip, resource)
@@ -913,8 +913,8 @@ func startIPInformers(ctx context.Context, wg *sync.WaitGroup) {
913913
if !ok {
914914
return
915915
}
916+
Ipcache.Delete(pod.Status.PodIP)
916917

917-
updateIP("POD", pod.Namespace, pod.Name, "")
918918
},
919919
})
920920

@@ -945,7 +945,7 @@ func startIPInformers(ctx context.Context, wg *sync.WaitGroup) {
945945
if !ok {
946946
return
947947
}
948-
updateIP("SERVICE", svc.Namespace, svc.Name, "")
948+
Ipcache.Delete(svc.Spec.ClusterIP)
949949
},
950950
})
951951

0 commit comments

Comments
 (0)