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(contrib): get nacos service of customize group name #1798

Merged
merged 13 commits into from
Feb 22, 2022
4 changes: 3 additions & 1 deletion contrib/registry/nacos/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strconv"

"github.com/nacos-group/nacos-sdk-go/clients/naming_client"
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"

"github.com/go-kratos/kratos/v2/registry"
Expand Down Expand Up @@ -65,7 +66,7 @@ func New(cli naming_client.INamingClient, opts ...Option) (r *Registry) {
op := options{
prefix: "/microservices",
cluster: "DEFAULT",
group: "DEFAULT_GROUP",
group: constant.DEFAULT_GROUP,
weight: 100,
kind: "grpc",
}
Expand Down Expand Up @@ -167,6 +168,7 @@ func (r *Registry) Watch(ctx context.Context, serviceName string) (registry.Watc
func (r *Registry) GetService(_ context.Context, serviceName string) ([]*registry.ServiceInstance, error) {
res, err := r.cli.SelectInstances(vo.SelectInstancesParam{
ServiceName: serviceName,
GroupName: r.opts.group,
HealthyOnly: true,
})
if err != nil {
Expand Down