mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-09-22 16:41:01 +02:00
azure: add aaaa support
This commit is contained in:
parent
b2de466aa5
commit
e9fb8a8f36
@ -344,6 +344,19 @@ func (p *AzureProvider) newRecordSet(endpoint *endpoint.Endpoint) (dns.RecordSet
|
||||
ARecords: aRecords,
|
||||
},
|
||||
}, nil
|
||||
case dns.RecordTypeAAAA:
|
||||
aaaaRecords := make([]*dns.AaaaRecord, len(endpoint.Targets))
|
||||
for i, target := range endpoint.Targets {
|
||||
aaaaRecords[i] = &dns.AaaaRecord{
|
||||
IPv6Address: to.Ptr(target),
|
||||
}
|
||||
}
|
||||
return dns.RecordSet{
|
||||
Properties: &dns.RecordSetProperties{
|
||||
TTL: to.Ptr(ttl),
|
||||
AaaaRecords: aaaaRecords,
|
||||
},
|
||||
}, nil
|
||||
case dns.RecordTypeCNAME:
|
||||
return dns.RecordSet{
|
||||
Properties: &dns.RecordSetProperties{
|
||||
@ -410,6 +423,16 @@ func extractAzureTargets(recordSet *dns.RecordSet) []string {
|
||||
return targets
|
||||
}
|
||||
|
||||
// Check for AAAA records
|
||||
aaaaRecords := properties.AaaaRecords
|
||||
if len(aaaaRecords) > 0 && (aaaaRecords)[0].IPv6Address != nil {
|
||||
targets := make([]string, len(aaaaRecords))
|
||||
for i, aaaaRecord := range aaaaRecords {
|
||||
targets[i] = *aaaaRecord.IPv6Address
|
||||
}
|
||||
return targets
|
||||
}
|
||||
|
||||
// Check for CNAME records
|
||||
cnameRecord := properties.CnameRecord
|
||||
if cnameRecord != nil && cnameRecord.Cname != nil {
|
||||
|
@ -335,6 +335,19 @@ func (p *AzurePrivateDNSProvider) newRecordSet(endpoint *endpoint.Endpoint) (pri
|
||||
ARecords: aRecords,
|
||||
},
|
||||
}, nil
|
||||
case privatedns.RecordTypeAAAA:
|
||||
aaaaRecords := make([]*privatedns.AaaaRecord, len(endpoint.Targets))
|
||||
for i, target := range endpoint.Targets {
|
||||
aaaaRecords[i] = &privatedns.AaaaRecord{
|
||||
IPv6Address: to.Ptr(target),
|
||||
}
|
||||
}
|
||||
return privatedns.RecordSet{
|
||||
Properties: &privatedns.RecordSetProperties{
|
||||
TTL: to.Ptr(ttl),
|
||||
AaaaRecords: aaaaRecords,
|
||||
},
|
||||
}, nil
|
||||
case privatedns.RecordTypeCNAME:
|
||||
return privatedns.RecordSet{
|
||||
Properties: &privatedns.RecordSetProperties{
|
||||
@ -393,6 +406,16 @@ func extractAzurePrivateDNSTargets(recordSet *privatedns.RecordSet) []string {
|
||||
return targets
|
||||
}
|
||||
|
||||
// Check for AAAA records
|
||||
aaaaRecords := properties.AaaaRecords
|
||||
if len(aaaaRecords) > 0 && (aaaaRecords)[0].IPv6Address != nil {
|
||||
targets := make([]string, len(aaaaRecords))
|
||||
for i, aaaaRecord := range aaaaRecords {
|
||||
targets[i] = *aaaaRecord.IPv6Address
|
||||
}
|
||||
return targets
|
||||
}
|
||||
|
||||
// Check for CNAME records
|
||||
cnameRecord := properties.CnameRecord
|
||||
if cnameRecord != nil && cnameRecord.Cname != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user