Use ConfigMap to store operator's config

This commit is contained in:
Murat Kabilov
2017-05-12 11:41:34 +02:00
parent 47e3e29a56
commit da438aab3a
16 changed files with 323 additions and 147 deletions
-16
View File
@@ -12,7 +12,6 @@ import (
"k8s.io/client-go/pkg/api/v1"
"github.bus.zalan.do/acid/postgres-operator/pkg/spec"
"github.bus.zalan.do/acid/postgres-operator/pkg/util/constants"
)
var passwordChars = []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
@@ -37,21 +36,6 @@ func NameFromMeta(meta v1.ObjectMeta) spec.NamespacedName {
}
}
func PodClusterName(pod *v1.Pod) spec.NamespacedName {
if name, ok := pod.Labels[constants.ClusterNameLabel]; ok {
return spec.NamespacedName{
Namespace: pod.Namespace,
Name: name,
}
}
return spec.NamespacedName{}
}
func PodSpiloRole(pod *v1.Pod) string {
return pod.Labels[constants.SpiloRoleLabel]
}
func PGUserPassword(user spec.PgUser) string {
s := md5.Sum([]byte(user.Password + user.Name))