Fixing dbType from non supported CR
Added checks for non existing dbType variable in the CR.
This is done in order to support previous CRs.
Fixes:
@@ -499,7 +499,8 @@ func (r *Reconciler) ReconcileDB() error {
var err error = nil
if r.NooBaa.Spec.DBType == "postgres" {
err = r.ReconcileObject(r.NooBaaPostgresDB, r.SetDesiredNooBaaDB)
- } else if r.NooBaa.Spec.DBType == "mongodb" {
+ // Making sure that previous CRs without the value will deploy MongoDB
+ } else if r.NooBaa.Spec.DBType == "" || r.NooBaa.Spec.DBType == "mongodb" {
err = r.ReconcileObject(r.NooBaaMongoDB, r.SetDesiredNooBaaDB)
} else {
err = util.NewPersistentError("UnknownDBType", "Unknown dbType is specified in NooBaa spec")
