use sync methods while updating the cluster

This commit is contained in:
Murat Kabilov
2017-11-03 12:00:43 +01:00
committed by GitHub
parent 47dd766fa7
commit 86803406db
9 changed files with 455 additions and 381 deletions
+1 -4
View File
@@ -193,7 +193,7 @@ func (c *Controller) processEvent(event spec.ClusterEvent) {
return
}
c.curWorkerCluster.Store(event.WorkerID, cl)
if err := cl.Update(event.NewSpec); err != nil {
if err := cl.Update(event.OldSpec, event.NewSpec); err != nil {
cl.Error = fmt.Errorf("could not update cluster: %v", err)
lg.Error(cl.Error)
@@ -374,9 +374,6 @@ func (c *Controller) postgresqlUpdate(prev, cur interface{}) {
if !ok {
c.logger.Errorf("could not cast to postgresql spec")
}
if pgOld.ResourceVersion == pgNew.ResourceVersion {
return
}
if reflect.DeepEqual(pgOld.Spec, pgNew.Spec) {
return
}