mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 08:51:02 -06:00
Expose etcd client MaxCallSendMsgSize config
The etcdv3 client has a default request send limit of 2.0 MiB. This change exposes the configuration option to increase that limit enabling larger state using the etcdv3 backend. This also requires that the corresponding --max-request-bytes flag be increased on the server side. The default there is 1.5 MiB. Fixes https://github.com/hashicorp/terraform/issues/25745
This commit is contained in:
parent
271352620b
commit
d1608d7a7f
@ -15,6 +15,7 @@ const (
|
|||||||
usernameEnvVarName = "ETCDV3_USERNAME"
|
usernameEnvVarName = "ETCDV3_USERNAME"
|
||||||
passwordKey = "password"
|
passwordKey = "password"
|
||||||
passwordEnvVarName = "ETCDV3_PASSWORD"
|
passwordEnvVarName = "ETCDV3_PASSWORD"
|
||||||
|
maxRequestBytesKey = "max_request_bytes"
|
||||||
prefixKey = "prefix"
|
prefixKey = "prefix"
|
||||||
lockKey = "lock"
|
lockKey = "lock"
|
||||||
cacertPathKey = "cacert_path"
|
cacertPathKey = "cacert_path"
|
||||||
@ -49,6 +50,13 @@ func New() backend.Backend {
|
|||||||
DefaultFunc: schema.EnvDefaultFunc(passwordEnvVarName, ""),
|
DefaultFunc: schema.EnvDefaultFunc(passwordEnvVarName, ""),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
maxRequestBytesKey: &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
Description: "The max request size to send to etcd.",
|
||||||
|
Default: 0,
|
||||||
|
},
|
||||||
|
|
||||||
prefixKey: &schema.Schema{
|
prefixKey: &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
@ -128,6 +136,9 @@ func (b *Backend) rawClient() (*etcdv3.Client, error) {
|
|||||||
if v, ok := b.data.GetOk(passwordKey); ok && v.(string) != "" {
|
if v, ok := b.data.GetOk(passwordKey); ok && v.(string) != "" {
|
||||||
config.Password = v.(string)
|
config.Password = v.(string)
|
||||||
}
|
}
|
||||||
|
if v, ok := b.data.GetOk(maxRequestBytesKey); ok && v.(int) != 0 {
|
||||||
|
config.MaxCallSendMsgSize = v.(int)
|
||||||
|
}
|
||||||
if v, ok := b.data.GetOk(cacertPathKey); ok && v.(string) != "" {
|
if v, ok := b.data.GetOk(cacertPathKey); ok && v.(string) != "" {
|
||||||
tlsInfo.TrustedCAFile = v.(string)
|
tlsInfo.TrustedCAFile = v.(string)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user