mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-06 19:37:59 +02:00
rename service field to services as it contains service per role
This commit is contained in:
+3
-3
@@ -43,7 +43,7 @@ func (c *Cluster) Sync() error {
|
||||
c.logger.Debugf("syncing services")
|
||||
for _, role := range []postgresRole{master, replica} {
|
||||
if role == replica && !c.Spec.ReplicaLoadBalancer {
|
||||
if c.Service[role] != nil {
|
||||
if c.Services[role] != nil {
|
||||
// delete the left over replica service
|
||||
if err := c.deleteService(role); err != nil {
|
||||
return fmt.Errorf("could not delete obsolete %s service: %v", role, err)
|
||||
@@ -82,7 +82,7 @@ func (c *Cluster) Sync() error {
|
||||
|
||||
func (c *Cluster) syncService(role postgresRole) error {
|
||||
cSpec := c.Spec
|
||||
if c.Service[role] == nil {
|
||||
if c.Services[role] == nil {
|
||||
c.logger.Infof("could not find the cluster's %s service", role)
|
||||
svc, err := c.createService(role)
|
||||
if err != nil {
|
||||
@@ -98,7 +98,7 @@ func (c *Cluster) syncService(role postgresRole) error {
|
||||
if match {
|
||||
return nil
|
||||
}
|
||||
c.logServiceChanges(role, c.Service[role], desiredSvc, false, reason)
|
||||
c.logServiceChanges(role, c.Services[role], desiredSvc, false, reason)
|
||||
|
||||
if err := c.updateService(role, desiredSvc); err != nil {
|
||||
return fmt.Errorf("could not update %s service to match desired state: %v", role, err)
|
||||
|
||||
Reference in New Issue
Block a user