1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00

fix: set grpc resolver explicitly in yandex (#3838)

use passthrough resolver to be consistent with ycsdk library, and to
work correctly in dual-stack environments until gRPC proposal A61 is
fully implemented in grpc-go

fixes #3837

Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks>
Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
This commit is contained in:
Viktor Oreshkin 2024-08-29 17:21:08 +03:00 committed by GitHub
parent a1722cbfaa
commit 267e5ea9f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,7 +57,16 @@ func NewGrpcConnection(
return nil, err
}
return grpc.NewClient(serviceAPIEndpoint.Address,
// Until gRPC proposal A61 is implemented in grpc-go, default gRPC name resolver (dns)
// is incompatible with dualstack backends, and YC API backends are dualstack.
// However, if passthrough resolver is used instead, grpc-go won't do any name resolution
// and will pass the endpoint to net.Dial as-is, which would utilize happy-eyeballs
// support in Go's net package.
// So we explicitly set gRPC resolver to `passthrough` to match `ycsdk`s behavior,
// which uses `passthrough` resolver implicitly by using deprecated grpc.DialContext
// instead of grpc.NewClient used here
target := "passthrough:///" + serviceAPIEndpoint.Address
return grpc.NewClient(target,
grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig)),
grpc.WithKeepaliveParams(keepalive.ClientParameters{
Time: time.Second * 30,