Skip to content

Commit

Permalink
Merge branch 'master' into sonic_api
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeiser authored Apr 24, 2021
2 parents 6c78bce + d848cc7 commit cb6baa1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions providers/dns/exoscale/exoscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ func NewDefaultConfig() *Config {
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout),
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
HTTPClient: &http.Client{
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
Transport: http.DefaultTransport,
},
}
}
Expand Down Expand Up @@ -88,8 +89,12 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
config.Endpoint = defaultBaseURL
}

client := egoscale.NewClient(config.Endpoint, config.APIKey, config.APISecret)
client.HTTPClient = config.HTTPClient
client := egoscale.NewClient(
config.Endpoint,
config.APIKey,
config.APISecret,
egoscale.WithHTTPClient(config.HTTPClient),
)

return &DNSProvider{client: client, config: config}, nil
}
Expand Down Expand Up @@ -174,7 +179,7 @@ func (d *DNSProvider) FindExistingRecordID(zone, recordName string) (int64, erro
ctx := context.Background()
records, err := d.client.GetRecords(ctx, zone)
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 {
if record.Name == recordName {
Expand Down

0 comments on commit cb6baa1

Please sign in to comment.