mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Enable IPv6 for AAAA NS1 monitors
This commit is contained in:
@@ -1047,6 +1047,9 @@ class Ns1Provider(BaseProvider):
|
||||
'regions': self.monitor_regions,
|
||||
}
|
||||
|
||||
if _type == 'AAAA':
|
||||
ret['config']['v6'] = True
|
||||
|
||||
if record.healthcheck_protocol != 'TCP':
|
||||
# IF it's HTTP we need to send the request string
|
||||
path = record.healthcheck_path
|
||||
|
@@ -608,6 +608,54 @@ class TestNs1ProviderDynamic(TestCase):
|
||||
'meta': {},
|
||||
})
|
||||
|
||||
def aaaa_record(self):
|
||||
return Record.new(self.zone, '', {
|
||||
'dynamic': {
|
||||
'pools': {
|
||||
'lhr': {
|
||||
'fallback': 'iad',
|
||||
'values': [{
|
||||
'value': '::ffff:3.4.5.6',
|
||||
}],
|
||||
},
|
||||
'iad': {
|
||||
'values': [{
|
||||
'value': '::ffff:1.2.3.4',
|
||||
}, {
|
||||
'value': '::ffff:2.3.4.5',
|
||||
}],
|
||||
},
|
||||
},
|
||||
'rules': [{
|
||||
'geos': [
|
||||
'AF',
|
||||
'EU-GB',
|
||||
'NA-US-FL'
|
||||
],
|
||||
'pool': 'lhr',
|
||||
}, {
|
||||
'geos': [
|
||||
'AF-ZW',
|
||||
],
|
||||
'pool': 'iad',
|
||||
}, {
|
||||
'pool': 'iad',
|
||||
}],
|
||||
},
|
||||
'octodns': {
|
||||
'healthcheck': {
|
||||
'host': 'send.me',
|
||||
'path': '/_ping',
|
||||
'port': 80,
|
||||
'protocol': 'HTTP',
|
||||
}
|
||||
},
|
||||
'ttl': 32,
|
||||
'type': 'AAAA',
|
||||
'value': '::ffff:1.2.3.4',
|
||||
'meta': {},
|
||||
})
|
||||
|
||||
def cname_record(self):
|
||||
return Record.new(self.zone, 'foo', {
|
||||
'dynamic': {
|
||||
@@ -872,6 +920,14 @@ class TestNs1ProviderDynamic(TestCase):
|
||||
# No http response expected
|
||||
self.assertFalse('rules' in monitor)
|
||||
|
||||
def test_monitor_gen_AAAA(self):
|
||||
provider = Ns1Provider('test', 'api-key')
|
||||
|
||||
value = '::ffff:3.4.5.6'
|
||||
record = self.aaaa_record()
|
||||
monitor = provider._monitor_gen(record, value)
|
||||
self.assertTrue(monitor['config']['v6'])
|
||||
|
||||
def test_monitor_gen_CNAME(self):
|
||||
provider = Ns1Provider('test', 'api-key')
|
||||
|
||||
|
Reference in New Issue
Block a user