From f9718852ced1b308cf96d1f13591c3ac8f72948c Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Wed, 8 Jan 2025 15:54:13 +0100 Subject: [PATCH 1/2] DOCS: Rackspace Cloud DNS provider request (#3322) --- documentation/provider/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/provider/index.md b/documentation/provider/index.md index f27b850cf..b256e303a 100644 --- a/documentation/provider/index.md +++ b/documentation/provider/index.md @@ -173,6 +173,7 @@ code to support this provider, we'd be glad to help in any way. * [Infoblox DNS](https://github.com/StackExchange/dnscontrol/issues/1077) (#1077) * [Joker.com](https://github.com/StackExchange/dnscontrol/issues/854) (#854) * [Plesk](https://github.com/StackExchange/dnscontrol/issues/2261) (#2261) +* [Rackspace Cloud DNS](https://github.com/StackExchange/dnscontrol/issues/2980) (#2980) * [RcodeZero](https://github.com/StackExchange/dnscontrol/issues/884) (#884) * [SynergyWholesale](https://github.com/StackExchange/dnscontrol/issues/1605) (#1605) * [UltraDNS by Neustar / CSCGlobal](https://github.com/StackExchange/dnscontrol/issues/1533) (#1533) From 2461f3dc50314325a3b66d3eb3e3122caf143e08 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Wed, 8 Jan 2025 11:10:07 -0500 Subject: [PATCH 2/2] REFACTOR: prettysort should unify FQDN to "@" earlier (#3323) --- pkg/prettyzone/sorting.go | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/pkg/prettyzone/sorting.go b/pkg/prettyzone/sorting.go index ff214bd92..160421dcc 100644 --- a/pkg/prettyzone/sorting.go +++ b/pkg/prettyzone/sorting.go @@ -27,16 +27,16 @@ func (z *ZoneGenData) Less(i, j int) bool { // Sort by name. - // If we are at the apex, use "@" in the sorting. - compA, compB := a.NameFQDN, b.NameFQDN //fmt.Printf("DEBUG: LabelLess(%q, %q) = %v %q %q\n", compA, compB, LabelLess(compA, compB), a.Name, b.Name) + compA, compB := a.NameFQDN, b.NameFQDN + // If we are at the apex, pass "@" to the Less function. + if a.Name == "@" { + compA = "@" + } + if b.Name == "@" { + compB = "@" + } if compA != compB { - if a.Name == "@" { - compA = "@" - } - if b.Name == "@" { - compB = "@" - } return LabelLess(compA, compB) } @@ -132,8 +132,7 @@ func (z *ZoneGenData) Less(i, j int) bool { func LabelLess(a, b string) bool { // Compare two zone labels for the purpose of sorting the RRs in a Zone. - // If they are equal, we are done. All other code is simplified - // because we can assume a!=b. + // If they are equal, we are done. The remainingi code can assume a != b. if a == b { return false } @@ -161,15 +160,15 @@ func LabelLess(a, b string) bool { ia := len(as) - 1 ib := len(bs) - 1 - var min int + var minIdx int if ia < ib { - min = len(as) - 1 + minIdx = len(as) - 1 } else { - min = len(bs) - 1 + minIdx = len(bs) - 1 } // Skip the matching highest elements, then compare the next item. - for i, j := ia, ib; min >= 0; i, j, min = i-1, j-1, min-1 { + for i, j := ia, ib; minIdx >= 0; i, j, minIdx = i-1, j-1, minIdx-1 { // Compare as[i] < bs[j] // Sort @ at the top, then *, then everything else. // i.e. @ always is less. * is is less than everything but @.