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:修复resolver无法过滤不健康以及隔离的实例 #71

Merged
merged 5 commits into from
Aug 27, 2024
Merged
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
2 changes: 1 addition & 1 deletion resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"google.golang.org/grpc/resolver"
)

type ResolverContext struct {

Check failure on line 36 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.15)

exported type ResolverContext should have comment or be unexported

Check failure on line 36 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.16)

exported type ResolverContext should have comment or be unexported

Check warning on line 36 in resolver.go

View workflow job for this annotation

GitHub Actions / Run Revive Action (1.17.x)

exported type ResolverContext should have comment or be unexported

Check failure on line 36 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.18)

exported type ResolverContext should have comment or be unexported

Check failure on line 36 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.17)

exported type ResolverContext should have comment or be unexported
Target resolver.Target
Host string
Port int
Expand All @@ -47,7 +47,7 @@

var resolverInterceptors []ResolverInterceptor

// RegisterResolverInterceptor

Check failure on line 50 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.15)

comment on exported function RegisterResolverInterceptor should be of the form "RegisterResolverInterceptor ..."

Check failure on line 50 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.16)

comment on exported function RegisterResolverInterceptor should be of the form "RegisterResolverInterceptor ..."

Check warning on line 50 in resolver.go

View workflow job for this annotation

GitHub Actions / Run Revive Action (1.17.x)

comment on exported function RegisterResolverInterceptor should be of the form "RegisterResolverInterceptor ..."

Check failure on line 50 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.18)

comment on exported function RegisterResolverInterceptor should be of the form "RegisterResolverInterceptor ..."

Check failure on line 50 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.17)

comment on exported function RegisterResolverInterceptor should be of the form "RegisterResolverInterceptor ..."
// NOTE: this function must only be called during initialization time (i.e. in
// an init() function), and is not thread-safe. If multiple RegisterInterceptor are
// registered with the same name, the one registered last will take effect.
Expand All @@ -55,7 +55,7 @@
resolverInterceptors = append(resolverInterceptors, i)
}

func NewResolver(ctx api.SDKContext) *resolverBuilder {

Check failure on line 58 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.15)

exported function NewResolver should have comment or be unexported

Check failure on line 58 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.16)

exported function NewResolver should have comment or be unexported

Check failure on line 58 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.18)

exported function NewResolver should have comment or be unexported

Check failure on line 58 in resolver.go

View workflow job for this annotation

GitHub Actions / build (1.17)

exported function NewResolver should have comment or be unexported
return &resolverBuilder{
sdkCtx: ctx,
}
Expand Down Expand Up @@ -84,7 +84,7 @@
if len(optionsStr) > 0 {
value, err := base64.URLEncoding.DecodeString(optionsStr)
if nil != err {
GetLogger().Error("[Polaris][Resolver] fail to decode endpoint %s, options %s: %w", target.URL.Opaque, optionsStr, err)

Check failure on line 87 in resolver.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.15.x)

the line is 123 characters long, which exceeds the maximum of 120 characters. (lll)

Check failure on line 87 in resolver.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.18.x)

the line is 123 characters long, which exceeds the maximum of 120 characters. (lll)

Check failure on line 87 in resolver.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.16.x)

the line is 123 characters long, which exceeds the maximum of 120 characters. (lll)

Check failure on line 87 in resolver.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.17.x)

the line is 123 characters long, which exceeds the maximum of 120 characters. (lll)
return nil, fmt.Errorf("fail to decode endpoint %s, options %s: %w", target.URL.Opaque, optionsStr, err)
}
if err = json.Unmarshal(value, options); nil != err {
Expand Down Expand Up @@ -190,7 +190,7 @@
GetInstancesRequest: model.GetInstancesRequest{
Namespace: getNamespace(pr.options),
Service: pr.host,
SkipRouteFilter: true,
SkipRouteFilter: false,
},
}
if len(pr.options.DstMetadata) > 0 {
Expand Down
Loading