Skip to content
Snippets Groups Projects
Commit 570fd592 authored by LaurenceLiZhixin's avatar LaurenceLiZhixin
Browse files

Fix

parent ed5b35c2
No related branches found
No related tags found
No related merge requests found
......@@ -5,9 +5,11 @@ import (
"github.com/apache/dubbo-go/remoting/k8sCRD"
)
const GroupName = "service.dubbo.apache.org"
const GroupVersion = "v1alpha1"
const Namespace = "dubbo-workplace"
const (
GroupName = "service.dubbo.apache.org"
GroupVersion = "v1alpha1"
Namespace = "dubbo-workplace"
)
func SetK8sEventListener(listener config_center.ConfigurationListener) error {
vsUniformRouterListenerHandler := newVirtualServiceListenerHandler(listener)
......
......@@ -31,7 +31,7 @@ func NewUniformRouterChain(virtualServiceConfig, destinationRuleConfig []byte, n
uniformRouters, err = parseFromConfigToRouters(virtualServiceConfig, destinationRuleConfig, notify)
if err != nil {
fromFileConfig = false
logger.Info("parse router config form local file failed")
logger.Warnf("parse router config form local file failed, error = %+v", err)
}
r := &RouterChain{
virtualServiceConfigBytes: virtualServiceConfig,
......@@ -40,7 +40,7 @@ func NewUniformRouterChain(virtualServiceConfig, destinationRuleConfig []byte, n
notify: notify,
}
if err := k8s_api.SetK8sEventListener(r); err != nil {
logger.Info("try listen K8s router config failed")
logger.Warnf("try listen K8s router config failed, error = %+v", err)
if !fromFileConfig {
return nil, perrors.New("No config file from both local file and k8s")
}
......
......@@ -176,7 +176,7 @@ func newUniformRule(dubboRoute *config.DubboRoute, destinationMap map[string]map
}
func (u *UniformRule) route(invokers []protocol.Invoker, url *common.URL, invocation protocol.Invocation) []protocol.Invoker {
// servicerule + destination -> filter
// service rule + destination -> filter
resultInvokers := make([]protocol.Invoker, 0)
matchService := false
for _, v := range u.services {
......@@ -188,7 +188,7 @@ func (u *UniformRule) route(invokers []protocol.Invoker, url *common.URL, invoca
if !matchService {
return resultInvokers
}
// routeDeatail level match
// route Details level match
for _, rule := range u.virtualServiceRules {
if rule.match(url, invocation) {
resultInvokers, err := rule.getRuleTargetInvokers(invokers)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment