Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add root NS support. #49

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.0.5 - 2023-12-xx - Root NS support

* Add support for root NS updates

## v0.0.4 - 2023-04-27 - ALIAS support

* add support for ALIAS as a CNAME at root
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ providers:

#### Records

Supports A, AAAA, NS, MX, TXT, SRV, CNAME, and PTR
Supports A, AAAA, ALIAS (CNAME flattening), NS, MX, TXT, SRV, CNAME, and PTR.
CNAME flattening resolves both A and AAAA records and inherits the upstream TTL.

#### Root NS Records
The GCore provider supports full root NS record management.

#### Dynamic

Expand Down
1 change: 1 addition & 0 deletions octodns_gcore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def _build_url(base, *items):
class _BaseProvider(BaseProvider):
SUPPORTS_GEO = False
SUPPORTS_DYNAMIC = True
SUPPORTS_ROOT_NS = True
SUPPORTS = set(
("A", "AAAA", "ALIAS", "CAA", "NS", "MX", "TXT", "SRV", "CNAME", "PTR")
)
Expand Down
17 changes: 14 additions & 3 deletions tests/test_octodns_provider_gcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ def test_apply(self):
plan = provider.plan(self.expected)

# TC: create all
self.assertEqual(14, len(plan.changes))
self.assertEqual(14, provider.apply(plan))
self.assertEqual(15, len(plan.changes))
self.assertEqual(15, provider.apply(plan))
self.assertFalse(plan.exists)

provider._client._request.assert_has_calls(
Expand Down Expand Up @@ -291,6 +291,17 @@ def test_apply(self):
],
},
),
call(
"POST",
"http://api/zones/unit.tests/unit.tests./NS",
data={
"ttl": 300,
"resource_records": [
{"content": ["ns1.gcorelabs.net."]},
{"content": ["ns2.gcdn.services."]},
],
},
),
call(
"POST",
"http://api/zones/unit.tests/_imap._tcp.unit.tests./SRV",
Expand Down Expand Up @@ -416,7 +427,7 @@ def test_apply(self):
]
)
# expected number of total calls
self.assertEqual(17, provider._client._request.call_count)
self.assertEqual(18, provider._client._request.call_count)

# TC: delete 1 and update 1
provider._client._request.reset_mock()
Expand Down