fix minor database upgrade to not sleep but wait for delete of pod
@@ -76,9 +76,11 @@ func (r DatabaseStrategy1) MinorUpgrade(clientset *kubernetes.Clientset, client
}
log.Info("deleted pod " + db.Spec.Name + " in namespace " + namespace)
- //TODO replace this sleep with a wait
-
- time.Sleep(5000 * time.Millisecond)
+ err = util.WaitUntilPodIsDeleted(clientset, db.Spec.Name, time.Minute, namespace)
+ if err != nil {
+ log.Error(err.Error())
+ return err
+ }
//start pod
@@ -89,6 +91,7 @@ func (r DatabaseStrategy1) MinorUpgrade(clientset *kubernetes.Clientset, client
CCP_IMAGE_TAG: upgrade.Spec.CCP_IMAGE_TAG,
PG_MASTER_USER: db.Spec.PG_MASTER_USER,
PG_MASTER_PASSWORD: db.Spec.PG_MASTER_PASSWORD,
+ PGDATA_PATH_OVERRIDE: db.Spec.Name,
PG_USER: db.Spec.PG_USER,
PG_PASSWORD: db.Spec.PG_PASSWORD,
PG_DATABASE: db.Spec.PG_DATABASE,
