From 6051473ffcdbcebbf6a4e64a0fcc94aeed96f1ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=91=9E=E6=96=8C?= Date: Mon, 21 Oct 2024 20:08:03 +0800 Subject: [PATCH] volcengine: set API information within the default configuration (#2308) Co-authored-by: Fernandez Ludovic --- providers/dns/volcengine/volcengine.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/providers/dns/volcengine/volcengine.go b/providers/dns/volcengine/volcengine.go index 80933b4c18..7dc1054d60 100644 --- a/providers/dns/volcengine/volcengine.go +++ b/providers/dns/volcengine/volcengine.go @@ -54,6 +54,10 @@ type Config struct { // NewDefaultConfig returns a default configuration for the DNSProvider. func NewDefaultConfig() *Config { return &Config{ + Scheme: env.GetOrDefaultString(EnvScheme, "https"), + Host: env.GetOrDefaultString(EnvHost, "open.volcengineapi.com"), + Region: env.GetOrDefaultString(EnvRegion, volc.DefaultRegion), + TTL: env.GetOrDefaultInt(EnvTTL, defaultTTL), PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 240*time.Second), PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, 10*time.Second), @@ -81,9 +85,6 @@ func NewDNSProvider() (*DNSProvider, error) { config := NewDefaultConfig() config.AccessKey = values[EnvAccessKey] config.SecretKey = values[EnvSecretKey] - config.Scheme = env.GetOrDefaultString(EnvScheme, "https") - config.Host = env.GetOrDefaultString(EnvHost, "open.volcengineapi.com") - config.Region = env.GetOrDefaultString(EnvRegion, volc.DefaultRegion) return NewDNSProviderConfig(config) }