From fb87e805ca45393c0eb6045a1510df87d63ca383 Mon Sep 17 00:00:00 2001 From: Enrique Lacal Date: Fri, 26 Jun 2026 15:58:33 +0100 Subject: [PATCH] Add missing translation for ffdns Signed-off-by: Enrique Lacal --- pkg/ffdns/ffdns_test.go | 13 +++++++++++++ pkg/i18n/en_base_config_descriptions.go | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/ffdns/ffdns_test.go b/pkg/ffdns/ffdns_test.go index 9e21130..90fe671 100644 --- a/pkg/ffdns/ffdns_test.go +++ b/pkg/ffdns/ffdns_test.go @@ -72,6 +72,19 @@ func TestNewResolverWithConfig(t *testing.T) { assert.NotNil(t, r.Dial) } +func TestConfigKeysDocumented(t *testing.T) { + // Initialize the DNS config as a subsection (as ffresty/wsclient do), then generate the + // config markdown for every known key. This panics if any key is missing a translation, + // guarding against the "Translation for config key '...dns.servers' was not found" regression. + config.RootConfigReset() + InitConfig(config.RootSection("backend").SubSection("dns")) + + assert.NotPanics(t, func() { + _, err := config.GenerateConfigMarkdown(context.Background(), "", config.GetKnownKeys()) + assert.NoError(t, err) + }) +} + func TestNewResolverFromConfigSection(t *testing.T) { resetConf() utConf.Set(DNSServers, []string{"8.8.8.8", "1.1.1.1:53"}) diff --git a/pkg/i18n/en_base_config_descriptions.go b/pkg/i18n/en_base_config_descriptions.go index 1ef4b70..b2146ef 100644 --- a/pkg/i18n/en_base_config_descriptions.go +++ b/pkg/i18n/en_base_config_descriptions.go @@ -90,7 +90,8 @@ var ( ConfigGlobalMaxIdleConns = ffc("config.global.maxIdleConns", "The max number of idle connections to hold pooled", IntType) ConfigGlobalMaxConnsPerHost = ffc("config.global.maxConnsPerHost", "The max number of connections, per unique hostname. Zero means no limit", IntType) ConfigGlobalMaxIdleConnsPerHost = ffc("config.global.maxIdleConnsPerHost", "The max number of idle connections, per unique hostname. Zero means net/http uses the default of only 2.", IntType) - ConfigGlobalDNSServers = ffc("config.global.dnsServers", "An optional list of DNS server addresses (host or host:port, port defaults to 53) to use instead of the system resolver. Setting this forces use of Go's built-in DNS resolver.", ArrayStringType) + ConfigGlobalDNSServers = ffc("config.global.dns.servers", "An optional list of DNS server addresses (host or host:port, port defaults to 53) to use instead of the system resolver. Setting this forces use of Go's built-in DNS resolver.", ArrayStringType) + ConfigGlobalDNSTimeout = ffc("config.global.dns.timeout", "The dial timeout when contacting a configured DNS server", TimeDurationType) ConfigGlobalMethod = ffc("config.global.method", "The HTTP method to use when making requests to the Address Resolver", StringType) ConfigGlobalAuthType = ffc("config.global.auth.type", "The auth plugin to use for server side authentication of requests", StringType) ConfigGlobalPassthroughHeadersEnabled = ffc("config.global.passthroughHeadersEnabled", "Enable passing through the set of allowed HTTP request headers", BooleanType)