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

Not work with grpc v1.53.0 #34

Closed
erisenxu opened this issue Feb 17, 2023 · 6 comments
Closed

Not work with grpc v1.53.0 #34

erisenxu opened this issue Feb 17, 2023 · 6 comments

Comments

@erisenxu
Copy link

The latest version v3.3.1 does not work with grpc v1.53.0. When compiling, I get the following error:

../go1.18.1/pkg/mod/github.com/sercand/kuberesolver/v3@v3.1.1/builder.go:81:12: invalid operation: end == "" (mismatched types func() string and untyped string)
../go1.18.1/pkg/mod/github.com/sercand/kuberesolver/v3@v3.1.1/builder.go:82:9: cannot use target.Authority (variable of type string) as type func() string in assignment
../go1.18.1/pkg/mod/github.com/sercand/kuberesolver/v3@v3.1.1/builder.go:86:12: invalid operation: end == "" (mismatched types func() string and untyped string)
../go1.18.1/pkg/mod/github.com/sercand/kuberesolver/v3@v3.1.1/builder.go:91:23: cannot use end (variable of type func() string) as type string in argument to strings.LastIndex
../go1.18.1/pkg/mod/github.com/sercand/kuberesolver/v3@v3.1.1/builder.go:92:10: cannot use end (variable of type func() string) as type string in assignment
../go1.18.1/pkg/mod/github.com/sercand/kuberesolver/v3@v3.1.1/builder.go:97:39: cannot use end (variable of type func() string) as type string in argument to net.SplitHostPort

This is because in grpc v1.53.0, the "target.Endpoint" is a function. Can you fix it?

@dannyskoog
Copy link

dannyskoog commented Feb 22, 2023

See #36

@dannyskoog
Copy link

@sercand 2 weeks+ have now passed and it's blocking people. Could you please have a look at the above PR?

@mikewiacek
Copy link

See #37

Different than PR 36 as net/url can't adequately parse named ports in URLs correctly. 37 above goes to some extensive efforts to make sure all the supported resolving approaches work. If I missed one, let me know.

@wyattanderson
Copy link
Contributor

Different than PR 36 as net/url can't adequately parse named ports in URLs correctly. 37 above goes to some extensive efforts to make sure all the supported resolving approaches work. If I missed one, let me know.

@mikewiacek As far as I'm aware, #36 still supports all existing supported use cases. It's not that net/url can't adequately parse named ports in URLs, it's that ports in the authority component of RFC 3986 URLs must be numeric (see RFC 3986 § 3.2.3). As of grpc/grpc-go#4817, the Go gRPC target parser uses url.Parse to parse the dial target, so a custom resolver wouldn't ever even be able to handle a URL like kubernetes://service:port because that's not a valid RFC 3986 URL and gRPC now formally requires RFC 3986 URLs for targets.

@mikewiacek
Copy link

Totally true, but if the historic behavior was to allow named ports, then maintaining backwards compatibility may be important. Especially if using an older version of grpc. But I have no pride in the fight, I just wanted it work. :-)

@sercand
Copy link
Owner

sercand commented Mar 13, 2023

I'm really sorry for the late response. For some reason, I couldn't see the notifications for this.

#36 is merged and v4.0.0 released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants