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:
parent
a1722cbfaa
commit
267e5ea9f1
1 changed files with 10 additions and 1 deletions
|
@ -57,7 +57,16 @@ func NewGrpcConnection(
|
||||||
return nil, err
|
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.WithTransportCredentials(credentials.NewTLS(tlsConfig)),
|
||||||
grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
||||||
Time: time.Second * 30,
|
Time: time.Second * 30,
|
||||||
|
|
Loading…
Reference in a new issue