1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-02 07:24:20 +00:00

Add open port checks

This commit is contained in:
moelsayed
2018-01-16 20:29:09 +02:00
parent d351594098
commit c815ef5751
4 changed files with 276 additions and 0 deletions

View File

@@ -298,3 +298,20 @@ func (c *Cluster) ApplyAuthzResources(ctx context.Context) error {
}
return nil
}
func (c *Cluster) getUniqueHostList() []*hosts.Host {
hostList := []*hosts.Host{}
hostList = append(hostList, c.EtcdHosts...)
hostList = append(hostList, c.ControlPlaneHosts...)
hostList = append(hostList, c.WorkerHosts...)
// little trick to get a unique host list
uniqHostMap := make(map[*hosts.Host]bool)
for _, host := range hostList {
uniqHostMap[host] = true
}
uniqHostList := []*hosts.Host{}
for host := range uniqHostMap {
uniqHostList = append(uniqHostList, host)
}
return uniqHostList
}