Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: xds enhancement #1853

Merged
merged 3 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
LaurenceLiZhixin marked this conversation as resolved.
Show resolved Hide resolved
return buffer.String()
}

Expand Down