fix(integrations): не считать CNAME hostname за IP при sync
Build and Push CFDM Docker Image / build-and-push (push) Successful in 1m49s
Build and Push CFDM Docker Image / create-release (push) Skipped
Build and Push CFDM Docker Image / update-wiki (push) Successful in 6s

JOIN dns_record клал content CNAME в target_ips и блокировал разворот до origin IP / service IPs.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-08-01 01:30:25 +07:00
co-authored by Cursor
parent ec70104085
commit 721332e767
6 changed files with 86 additions and 19 deletions
+38
View File
@@ -108,4 +108,42 @@ describe("resolveBindingIpsForSync", () => {
const ips = await resolveBindingIpsForSync(cname, ["198.51.100.7"], index);
expect(ips).toEqual(["198.51.100.7"]);
});
it("does not treat CNAME hostname in target_ips as an IP", async () => {
const target = binding({
id: 1,
hostname: "ihome",
zone_name: "rkns.top",
target_ips: ["203.0.113.10"],
});
const cname = binding({
id: 2,
hostname: "imsk",
zone_name: "rkns.top",
cname_target: "ihome.rkns.top",
// как в прод: JOIN dns_record кладёт CNAME content в target_ip → target_ips
target_ips: ["ihome.rkns.top"],
});
const index = {
byFqdn: new Map([
["ihome.rkns.top", target],
["imsk.rkns.top", cname],
]),
};
const ips = await resolveBindingIpsForSync(cname, [], index);
expect(ips).toEqual(["203.0.113.10"]);
});
it("prefers service IPs over empty CNAME resolution chain", async () => {
const cname = binding({
id: 2,
hostname: "mhome",
zone_name: "rkns.top",
cname_target: "macloud.rkns.top",
target_ips: ["macloud.rkns.top"],
});
const index = { byFqdn: new Map([["mhome.rkns.top", cname]]) };
const ips = await resolveBindingIpsForSync(cname, ["203.0.113.55"], index);
expect(ips).toEqual(["203.0.113.55"]);
});
});