From a7ba4346ad040e1f01164e165710f9a238ccd08a Mon Sep 17 00:00:00 2001 From: nil Date: Tue, 4 Jun 2024 18:05:00 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20plugin/circuitbreaker/composite/rule.go?= =?UTF-8?q?=20-=20=E4=BF=AE=E5=A4=8DsortCircuitBreakerRules=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=B8=ADrule.RuleMatcher.Destination.Method=E5=9C=A8r?= =?UTF-8?q?ule=E7=B1=BB=E5=9E=8B=E4=B8=BASERVICE=E6=88=96INSTANCE=E6=97=B6?= =?UTF-8?q?=E4=B8=BAnil=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/circuitbreaker/composite/rule.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/circuitbreaker/composite/rule.go b/plugin/circuitbreaker/composite/rule.go index 1c0b0abf..80cef9a3 100644 --- a/plugin/circuitbreaker/composite/rule.go +++ b/plugin/circuitbreaker/composite/rule.go @@ -210,11 +210,9 @@ func sortCircuitBreakerRules(rules []*fault_tolerance.CircuitBreakerRule) []*fau // 1. compare destination service destNamespace1 := rule1.RuleMatcher.Destination.Namespace destService1 := rule1.RuleMatcher.Destination.Service - destMethod1 := rule1.RuleMatcher.Destination.Method.Value.Value destNamespace2 := rule2.RuleMatcher.Destination.Namespace destService2 := rule2.RuleMatcher.Destination.Service - destMethod2 := rule2.RuleMatcher.Destination.Method.Value.Value svcResult := compareService(destNamespace1, destService1, destNamespace2, destService2) if svcResult != 0 { @@ -222,6 +220,8 @@ func sortCircuitBreakerRules(rules []*fault_tolerance.CircuitBreakerRule) []*fau } if rule1.Level == rule2.Level { if rule1.Level == fault_tolerance.Level_METHOD { + destMethod1 := rule1.RuleMatcher.Destination.Method.Value.Value + destMethod2 := rule2.RuleMatcher.Destination.Method.Value.Value methodResult := compareStringValue(destMethod1, destMethod2) if methodResult != 0 { return methodResult < 0