defaultInitDB enriches the initDB with defaults if not all the required arguments were passed
()
| 232 | |
| 233 | // defaultInitDB enriches the initDB with defaults if not all the required arguments were passed |
| 234 | func (r *Cluster) defaultInitDB() { |
| 235 | if r.Spec.Bootstrap.InitDB == nil { |
| 236 | r.Spec.Bootstrap.InitDB = &BootstrapInitDB{ |
| 237 | Database: DefaultApplicationDatabaseName, |
| 238 | Owner: DefaultApplicationUserName, |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | if r.Spec.Bootstrap.InitDB.Database == "" { |
| 243 | // Set the default only if not executing a monolithic import |
| 244 | if r.Spec.Bootstrap.InitDB.Import == nil || |
| 245 | r.Spec.Bootstrap.InitDB.Import.Type != MonolithSnapshotType { |
| 246 | r.Spec.Bootstrap.InitDB.Database = DefaultApplicationDatabaseName |
| 247 | } |
| 248 | } |
| 249 | if r.Spec.Bootstrap.InitDB.Owner == "" { |
| 250 | r.Spec.Bootstrap.InitDB.Owner = r.Spec.Bootstrap.InitDB.Database |
| 251 | } |
| 252 | if r.Spec.Bootstrap.InitDB.Encoding == "" { |
| 253 | r.Spec.Bootstrap.InitDB.Encoding = "UTF8" |
| 254 | } |
| 255 | if r.Spec.Bootstrap.InitDB.LocaleCollate == "" { |
| 256 | r.Spec.Bootstrap.InitDB.LocaleCollate = "C" |
| 257 | } |
| 258 | if r.Spec.Bootstrap.InitDB.LocaleCType == "" { |
| 259 | r.Spec.Bootstrap.InitDB.LocaleCType = "C" |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | // defaultRecovery enriches the recovery with defaults if not all the required arguments were passed |
| 264 | func (r *Cluster) defaultRecovery() { |