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
+12 -1
View File
@@ -72,7 +72,7 @@ func (c *Controller) createTPR() error {
restClient := c.RestClient
return k8sutil.WaitTPRReady(restClient, c.opConfig.TPR.ReadyWaitInterval, c.opConfig.TPR.ReadyWaitTimeout, c.PodNamespace)
return k8sutil.WaitTPRReady(restClient, c.opConfig.TPR.ReadyWaitInterval, c.opConfig.TPR.ReadyWaitTimeout, c.opConfig.Namespace)
}
func (c *Controller) getInfrastructureRoles() (result map[string]spec.PgUser, err error) {
@@ -125,3 +125,14 @@ Users:
return result, nil
}
func (c *Controller) PodClusterName(pod *v1.Pod) spec.NamespacedName {
if name, ok := pod.Labels[c.opConfig.ClusterNameLabel]; ok {
return spec.NamespacedName{
Namespace: pod.Namespace,
Name: name,
}
}
return spec.NamespacedName{}
}