Skip to content

Commit

Permalink
fix(dsr): change grpc resolver to passthrough
Browse files Browse the repository at this point in the history
When we used DialContext() before it was deprecated, it manually set the
default resolver to passthrough. NewClient() appears to not do this, and
then several versions of grpc ago, they defaulted to the DNS resolver
which broke our DSR implementation with CRI compatible container
engines.

I'm not 100% sure that there isn't a better way to specify this, but I
spent 20 - 30 minutes poking around the gRPC code base and I don't think
that I can see an easy way to do this outside of specifying it this way.

Furthermore, the project itself seems to advocate for this approach in
comments like those on: grpc/grpc-go#1846
  • Loading branch information
aauren committed Oct 21, 2024
1 parent 8bb7cbf commit 9d7c58b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/cri/remote_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ func NewRemoteRuntimeService(endpoint string, connectionTimeout time.Duration) (

klog.V(4).Infof("[RuntimeService] got endpoint %s (proto=%s, path=%s)", endpoint, proto, addr)

if proto != "unix" {
if proto == "unix" {
// Every since grpc.DialContext was deprecated, we no longer get the passthrough resolver for free, so we need
// to add it manually. See: https://github.com/grpc/grpc-go/issues/1846 for more context
addr = "passthrough:///" + addr
} else {
return nil, errors.New("[RuntimeService] only unix socket is currently supported")
}

Expand Down

0 comments on commit 9d7c58b

Please sign in to comment.