Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

[DO-NOT-MERGE] hack to add etcd SRV record for some experimentation #537

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions records/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ func (rg *RecordGenerator) InsertState(sj state.State, domain, ns, listener stri
rg.slaveRecords(sj, domain, spec)
rg.listenerRecord(listener, ns)
rg.masterRecord(domain, masters, sj.Leader)
rg.etcdRecord(domain, masters)
rg.taskRecords(sj, domain, spec, ipSources)

return nil
Expand Down Expand Up @@ -357,6 +358,17 @@ func (rg *RecordGenerator) masterRecord(domain string, masters []string, leader
}
}

// SRV record for etcd
func (rg *RecordGenerator) etcdRecord(domain string, masters []string) {
server := "_etcd-server._tcp." + domain + "."
client := "_etcd-client._tcp." + domain + "."
for idx, _ := range masters {
perMasterRecord := "master" + strconv.Itoa(idx) + "." + domain + "."
rg.insertRR(client, perMasterRecord + ":2379", SRV)
rg.insertRR(server, perMasterRecord + ":2380", SRV)
}
}

// A or AAAA record for mesos-dns (the name is listed in SOA replies)
func (rg *RecordGenerator) listenerRecord(listener string, ns string) {
if listener == "0.0.0.0" {
Expand Down