feat(join): check cluster conditions before join

This commit is contained in:
Yicheng Qin
2014-05-01 15:58:14 -07:00
parent 4e14604e5c
commit 001b1fcd46
3 changed files with 66 additions and 3 deletions

View File

@@ -224,7 +224,9 @@ func (ps *PeerServer) setClusterConfigHttpHandler(w http.ResponseWriter, req *ht
func (ps *PeerServer) getMachinesHttpHandler(w http.ResponseWriter, req *http.Request) {
machines := make([]*machineMessage, 0)
for _, name := range ps.registry.Names() {
machines = append(machines, ps.getMachineMessage(name))
if msg := ps.getMachineMessage(name); msg != nil {
machines = append(machines, msg)
}
}
json.NewEncoder(w).Encode(&machines)
}