Make sure the statefulset that is deleted manually gets re-created. (#191)

* Make sure the statefulset that is deleted manually gets re-created.

Per report and analysis by Manuel Gomez.

* Move the existence checks for other objects out of the Create functions.

create{Object} for services, endpoints and PDBs refused to continue if
there is a cached definition in the cluster, however, the only place
where it makes sense is when creating a new cluster. Note that contrary
to the statefulset this doesn't fix any issues, since those definitions
were nullified correspondingly when the sync code detected there is no
object present in the Kubernetes cluster.
This commit is contained in:
Oleksii Kliukin
2017-12-21 15:20:43 +01:00
committed by GitHub
parent 6c57334666
commit da0de8cff7
3 changed files with 13 additions and 13 deletions
+1
View File
@@ -245,6 +245,7 @@ func (c *Cluster) syncStatefulSet() error {
return fmt.Errorf("could not get statefulset: %v", err)
}
// statefulset does not exist, try to re-create it
c.Statefulset = nil
c.logger.Infof("could not find the cluster's statefulset")
pods, err := c.listPods()
if err != nil {