Integrate comments from code reviews

This commit is contained in:
Sergey Dudoladov
2017-12-22 12:53:57 +01:00
parent 011458fb05
commit b8bf97ab76
2 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -32,16 +32,20 @@ func (c *Controller) ClusterStatus(team, cluster string) (*spec.ClusterStatus, e
return status, nil
}
// GetClusterDatabasesMap returns for each cluster the list of databases running there
func (c *Controller) GetClusterDatabasesMap() map[string][]string {
// ClusterDatabasesMap returns for each cluster the list of databases running there
func (c *Controller) ClusterDatabasesMap() map[string][]string {
m := make(map[string][]string)
c.clustersMu.RLock()
for _, cluster := range c.clusters {
cluster.Lock()
for database := range cluster.Postgresql.Spec.Databases {
m[cluster.Name] = append(m[cluster.Name], database)
}
cluster.Unlock()
}
c.clustersMu.RUnlock()
return m
}