mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-18 07:20:07 +02:00
move from tpr to crd
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user