exoscale: fix DNS provider debugging (#1391)

This commit is contained in:
Marc Falzon 2021-04-20 12:08:06 +02:00 committed by GitHub
parent 4b22b38d7a
commit d848cc7f40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,7 +47,8 @@ func NewDefaultConfig() *Config {
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout), PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout),
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval), PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
HTTPClient: &http.Client{ HTTPClient: &http.Client{
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second), Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
Transport: http.DefaultTransport,
}, },
} }
} }
@ -88,8 +89,12 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
config.Endpoint = defaultBaseURL config.Endpoint = defaultBaseURL
} }
client := egoscale.NewClient(config.Endpoint, config.APIKey, config.APISecret) client := egoscale.NewClient(
client.HTTPClient = config.HTTPClient config.Endpoint,
config.APIKey,
config.APISecret,
egoscale.WithHTTPClient(config.HTTPClient),
)
return &DNSProvider{client: client, config: config}, nil return &DNSProvider{client: client, config: config}, nil
} }
@ -174,7 +179,7 @@ func (d *DNSProvider) FindExistingRecordID(zone, recordName string) (int64, erro
ctx := context.Background() ctx := context.Background()
records, err := d.client.GetRecords(ctx, zone) records, err := d.client.GetRecords(ctx, zone)
if err != nil { if err != nil {
return -1, errors.New("Error while retrievening DNS records: " + err.Error()) return -1, errors.New("Error while retrieving DNS records: " + err.Error())
} }
for _, record := range records { for _, record := range records {
if record.Name == recordName { if record.Name == recordName {