Compare commits

..

2 Commits

Author SHA1 Message Date
amery 78f7c31c9a cluster: introduce Cluster.WriteStringFile()
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-10-29 01:13:45 +00:00
amery 67d06084b5 cluster: introduce Cluster.RemoveFile()
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-10-29 01:13:45 +00:00
2 changed files with 2 additions and 13 deletions
-10
View File
@@ -175,16 +175,6 @@ func (mgr *Manager) genRegionsSorted() []string {
return SortRegions(regions)
}
func (mgr *Manager) genZonesSorted() []string {
zones := make([]string, 0, len(mgr.zones))
for name := range mgr.zones {
zones = append(zones, name)
}
sort.Strings(zones)
return zones
}
func (mgr *Manager) genAllAddrRecords() []AddrRecord {
var out []AddrRecord
+2 -3
View File
@@ -14,13 +14,12 @@ func (mgr *Manager) WriteTo(w io.Writer) (int64, error) {
cache := make(map[string][]netip.Addr)
// zones
for _, zoneName := range mgr.genZonesSorted() {
z := mgr.zones[zoneName]
for _, z := range mgr.zones {
mgr.writeZoneHosts(&buf, z)
// zone alias
addrs := mgr.genZoneAddresses(z)
zoneName := z.Name
rr := AddrRecord{
Name: mgr.fqdn(zoneName + mgr.suffix),