move from tpr to crd

This commit is contained in:
Murat Kabilov
2017-10-06 15:12:08 +02:00
parent bd9b0b613a
commit a35e9c6119
13 changed files with 141 additions and 115 deletions
+5 -3
View File
@@ -1,6 +1,6 @@
package cluster
// Postgres ThirdPartyResource object i.e. Spilo
// Postgres CustomResourceDefinition object i.e. Spilo
import (
"database/sql"
@@ -130,8 +130,10 @@ func (c *Cluster) setStatus(status spec.PostgresStatus) {
}
request := []byte(fmt.Sprintf(`{"status": %s}`, string(b))) //TODO: Look into/wait for k8s go client methods
_, err = c.KubeClient.RESTClient.Patch(types.MergePatchType).
RequestURI(c.GetSelfLink()).
_, err = c.KubeClient.CRDREST.Patch(types.MergePatchType).
Namespace(c.Namespace).
Resource(constants.CRDResource).
Name(c.Name).
Body(request).
DoRaw()
+1 -1
View File
@@ -143,7 +143,7 @@ func (c *Cluster) updateStatefulSet(newStatefulSet *v1beta1.StatefulSet) error {
return nil
}
// replaceStatefulSet deletes an old StatefulSet and creates the new using spec in the PostgreSQL TPR.
// replaceStatefulSet deletes an old StatefulSet and creates the new using spec in the PostgreSQL CRD.
func (c *Cluster) replaceStatefulSet(newStatefulSet *v1beta1.StatefulSet) error {
if c.Statefulset == nil {
return fmt.Errorf("there is no statefulset in the cluster")
+2 -2
View File
@@ -338,8 +338,8 @@ func (c *Cluster) credentialSecretNameForCluster(username string, clusterName st
return c.OpConfig.SecretNameTemplate.Format(
"username", strings.Replace(username, "_", "-", -1),
"clustername", clusterName,
"tprkind", constants.TPRKind,
"tprgroup", constants.TPRGroup)
"tprkind", constants.CRDKind,
"tprgroup", constants.CRDGroup)
}
func (c *Cluster) podSpiloRole(pod *v1.Pod) string {