mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-10 02:16:23 +02:00
Sort database by name.
This commit is contained in:
@@ -2,6 +2,7 @@ package controller
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
@@ -46,6 +47,7 @@ func (c *Controller) ClusterDatabasesMap() map[string][]string {
|
|||||||
for database := range spec.Spec.Databases {
|
for database := range spec.Spec.Databases {
|
||||||
m[cluster.Name] = append(m[cluster.Name], database)
|
m[cluster.Name] = append(m[cluster.Name], database)
|
||||||
}
|
}
|
||||||
|
sort.Strings(m[cluster.Name])
|
||||||
} else {
|
} else {
|
||||||
c.logger.Warningf("could not get the list of databases for cluster %q: %v", cluster.Name, err)
|
c.logger.Warningf("could not get the list of databases for cluster %q: %v", cluster.Name, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user