Skip to content

Commit

Permalink
Merge pull request #1853 from LaurenceLiZhixin/xds-feat-enhancement
Browse files Browse the repository at this point in the history
Fix: xds enhancement
  • Loading branch information
LaurenceLiZhixin authored Apr 25, 2022
2 parents 60d1c2a + dde8baa commit 84a131c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions common/proxy/proxy_factory/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func (factory *DefaultProxyFactory) GetAsyncProxy(invoker protocol.Invoker, call
// create proxy
attachments := map[string]string{}
attachments[constant.AsyncKey] = url.GetParam(constant.AsyncKey, "false")
attachments[constant.EnvironmentKey] = url.GetParam(constant.EnvironmentKey, "dev")
return proxy.NewProxy(invoker, callBack, attachments)
}

Expand Down
9 changes: 5 additions & 4 deletions registry/xds/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,24 @@ func getCategory(url *common.URL) string {
return category
}

// getServiceName return serviceName $(providers_or_consumers):$(interfaceName)
func getServiceName(url *common.URL) string {
var buffer bytes.Buffer

buffer.Write([]byte(getCategory(url)))
appendParam(&buffer, url, constant.InterfaceKey)
appendParam(&buffer, url, constant.VersionKey)
appendParam(&buffer, url, constant.GroupKey)
return buffer.String()
}

// getSubscribeName returns subscribeName is providers:$(interfaceName)
func getSubscribeName(url *common.URL) string {
var buffer bytes.Buffer

buffer.Write([]byte(common.DubboNodes[common.PROVIDER]))
appendParam(&buffer, url, constant.InterfaceKey)
appendParam(&buffer, url, constant.VersionKey)
appendParam(&buffer, url, constant.GroupKey)
// We would not append group or version to this name, as istio ecosystem only cares about 'hostname' during cds procedure.
// The subscribe name is used to find the real hostName.
// Group or version are managed by traffic policy, not dubbo-go.
return buffer.String()
}

Expand Down

0 comments on commit 84a131c

Please sign in to comment.