diff --git a/docs/ttl.md b/docs/ttl.md index 327c61f50..cfab65baf 100644 --- a/docs/ttl.md +++ b/docs/ttl.md @@ -79,4 +79,4 @@ The TransIP Provider minimal TTL is used when the TTL is 0. The minimal TTL is 6 The Vultr provider minimal TTL is used when the TTL is 0. The default is 1 hour. ### UltraDNS -The UltraDNS provider minimal TTL is used when the TTL is not given. The default ttl is account level ttl and if account level ttl is not defined then it is 24 hour. +The UltraDNS provider minimal TTL is used when the TTL is not provided. The default TTL is account level default TTL, if defined, otherwise 24 hours. diff --git a/docs/tutorials/ultradns.md b/docs/tutorials/ultradns.md index aa8f664fb..8b2d38fdf 100644 --- a/docs/tutorials/ultradns.md +++ b/docs/tutorials/ultradns.md @@ -207,7 +207,7 @@ Now that we have verified that ExternalDNS will automatically manage your UltraD $ kubectl delete service -f nginx.yaml $ kubectl delete service -f externaldns.yaml ``` -## Example to Manage your Records +## Examples to Manage your Records ### Creating Multiple A Records Target - First, you want to create a service file called 'apple-banana-echo.yaml' ```yaml diff --git a/provider/ultradns.go b/provider/ultradns.go index c988b8708..cfba0d455 100644 --- a/provider/ultradns.go +++ b/provider/ultradns.go @@ -144,16 +144,9 @@ func (p *UltraDNSProvider) Zones(ctx context.Context) ([]udnssdk.Zone, error) { if p.domainFilter.IsConfigured() { for _, zone := range p.domainFilter.Filters { - if p.AccountName != "" { - zoneKey.Zone = zone - zoneKey.AccountName = p.AccountName - zones, err = p.fetchZones(ctx, zoneKey) - - } else { - - zoneKey.Zone = zone - zones, err = p.fetchZones(ctx, zoneKey) - } + zoneKey.Zone = zone + zoneKey.AccountName = p.AccountName + zones, err = p.fetchZones(ctx, zoneKey) if err != nil { return nil, err @@ -166,10 +159,7 @@ func (p *UltraDNSProvider) Zones(ctx context.Context) ([]udnssdk.Zone, error) { return zones_appender, nil } else { - if p.AccountName != "" { - zoneKey.AccountName = p.AccountName - } - + zoneKey.AccountName = p.AccountName zones, err := p.fetchZones(ctx, zoneKey) if err != nil { return nil, err @@ -215,7 +205,7 @@ func (p *UltraDNSProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, e name = zone.Properties.Name } - endPointTTL := endpoint.NewEndpointWithTTL(name, recordTypeArray[0], endpoint.TTL(r.TTL.(float64)), r.RData...) + endPointTTL := endpoint.NewEndpointWithTTL(name, recordTypeArray[0], endpoint.TTL(r.TTL), r.RData...) endpoints = append(endpoints, endPointTTL) } } @@ -438,7 +428,7 @@ func (p *UltraDNSProvider) ApplyChanges(ctx context.Context, changes *plan.Chang func newUltraDNSChanges(action string, endpoints []*endpoint.Endpoint) []*UltraDNSChanges { changes := make([]*UltraDNSChanges, 0, len(endpoints)) - var ttl interface{} + var ttl int for _, e := range endpoints { if e.RecordTTL.IsConfigured() {