Skip to content

Commit f7ca3c1

Browse files
instance 命名空间恢复从 serviceKey 获取,即实例级熔断的治理规则适用 serviceKey 对应 namespace 的 (#580)
Co-authored-by: shedfreewu <[email protected]>
1 parent 730148c commit f7ca3c1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

polaris-common/polaris-model/src/main/java/com/tencent/polaris/client/pojo/InstanceByProto.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package com.tencent.polaris.client.pojo;
1919

20-
import com.google.protobuf.StringValue;
2120
import com.google.protobuf.UInt32Value;
2221
import com.tencent.polaris.api.pojo.CircuitBreakerStatus;
2322
import com.tencent.polaris.api.pojo.DetectResult;
@@ -31,7 +30,6 @@
3130
import java.util.Collections;
3231
import java.util.Map;
3332
import java.util.Objects;
34-
import java.util.Optional;
3533

3634
/**
3735
* 通过PB对象封装的实例信息
@@ -80,8 +78,7 @@ public int hashCode() {
8078

8179
@Override
8280
public String getNamespace() {
83-
return Optional.of(instance).map(ServiceProto.Instance::getNamespace).
84-
map(StringValue::getValue).orElse(serviceKey.getNamespace());
81+
return serviceKey.getNamespace();
8582
}
8683

8784
@Override

0 commit comments

Comments
 (0)