Skip to content

Commit 6051473

Browse files
liuruibinldez
andauthored
volcengine: set API information within the default configuration (#2308)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent d6c1ed9 commit 6051473

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

providers/dns/volcengine/volcengine.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ type Config struct {
5454
// NewDefaultConfig returns a default configuration for the DNSProvider.
5555
func NewDefaultConfig() *Config {
5656
return &Config{
57+
Scheme: env.GetOrDefaultString(EnvScheme, "https"),
58+
Host: env.GetOrDefaultString(EnvHost, "open.volcengineapi.com"),
59+
Region: env.GetOrDefaultString(EnvRegion, volc.DefaultRegion),
60+
5761
TTL: env.GetOrDefaultInt(EnvTTL, defaultTTL),
5862
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 240*time.Second),
5963
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, 10*time.Second),
@@ -81,9 +85,6 @@ func NewDNSProvider() (*DNSProvider, error) {
8185
config := NewDefaultConfig()
8286
config.AccessKey = values[EnvAccessKey]
8387
config.SecretKey = values[EnvSecretKey]
84-
config.Scheme = env.GetOrDefaultString(EnvScheme, "https")
85-
config.Host = env.GetOrDefaultString(EnvHost, "open.volcengineapi.com")
86-
config.Region = env.GetOrDefaultString(EnvRegion, volc.DefaultRegion)
8788

8889
return NewDNSProviderConfig(config)
8990
}

0 commit comments

Comments
 (0)