mirror of
https://github.com/siderolabs/talos.git
synced 2025-10-25 22:41:10 +02:00
fix: set max msg recv size when proxying
Previously a fix was deployed in the Talos API client, but when the request passes through `apid`, we need to make sure that proxy doesn't reject large responses. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
This commit is contained in:
parent
e22ab440d7
commit
e9c7ac17a9
@ -101,6 +101,9 @@ func (a *APID) GetConnection(ctx context.Context, fullMethodName string) (contex
|
||||
// see: https://github.com/grpc/grpc-go/blob/d5dee5fdbdeb52f6ea10b37b2cc7ce37814642d7/clientconn.go#L55-L56
|
||||
MinConnectTimeout: 20 * time.Second,
|
||||
}),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(constants.GRPCMaxMessageSize),
|
||||
),
|
||||
grpc.WithCodec(proxy.Codec()), //nolint:staticcheck
|
||||
grpc.WithSharedWriteBuffer(true),
|
||||
)
|
||||
|
||||
@ -14,6 +14,7 @@ import (
|
||||
"google.golang.org/grpc/metadata"
|
||||
|
||||
"github.com/siderolabs/talos/pkg/grpc/middleware/authz"
|
||||
"github.com/siderolabs/talos/pkg/machinery/constants"
|
||||
)
|
||||
|
||||
var _ proxy.Backend = (*Local)(nil)
|
||||
@ -60,6 +61,9 @@ func (l *Local) GetConnection(ctx context.Context, fullMethodName string) (conte
|
||||
ctx,
|
||||
"unix:"+l.socketPath,
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(constants.GRPCMaxMessageSize),
|
||||
),
|
||||
grpc.WithCodec(proxy.Codec()), //nolint:staticcheck
|
||||
grpc.WithSharedWriteBuffer(true),
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user