You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/03/31 22:14:25 UTC

[skywalking] branch master updated: Fix ALS K8SServiceRegistry didn't remove the correct entry (#6658)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 4af2b61  Fix ALS K8SServiceRegistry didn't remove the correct entry (#6658)
4af2b61 is described below

commit 4af2b61027233848f3fdd2850755b7c1959fc903
Author: wankai123 <wa...@foxmail.com>
AuthorDate: Thu Apr 1 06:14:01 2021 +0800

    Fix ALS K8SServiceRegistry didn't remove the correct entry (#6658)
    
    * Fix ALS K8SServiceRegistry didn't remove the correct entry
    
    * Add changes
    
    Co-authored-by: Zhenxu Ke <ke...@apache.org>
---
 CHANGES.md                                                              | 1 +
 .../oap/server/receiver/envoy/als/k8s/K8SServiceRegistry.java           | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGES.md b/CHANGES.md
index 2f55097..dc5441e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -63,6 +63,7 @@ Release Notes.
 * Optimize the self monitoring grafana dashboard.
 * Enhance the export service.
 * Add function `retagByK8sMeta` and opt type `K8sRetagType.Pod2Service` in MAL for k8s to relate pods and services.
+* Fix ALS K8SServiceRegistry didn't remove the correct entry.
 * Using "service.istio.io/canonical-name" to replace "app" label to resolve Envoy ALS service name
 
 #### UI
diff --git a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/k8s/K8SServiceRegistry.java b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/k8s/K8SServiceRegistry.java
index 104360e..158cd20 100644
--- a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/k8s/K8SServiceRegistry.java
+++ b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/k8s/K8SServiceRegistry.java
@@ -209,7 +209,7 @@ public class K8SServiceRegistry {
 
     protected void removeService(final V1Service service) {
         ofNullable(service.getMetadata()).ifPresent(
-            metadata -> idServiceMap.remove(metadata.getUid())
+            metadata -> idServiceMap.remove(metadata.getNamespace() + ":" + metadata.getName())
         );
     }