Skip to content

Commit

Permalink
Check if db version in app spec is null
Browse files Browse the repository at this point in the history
  • Loading branch information
kylape committed Jan 26, 2021
1 parent e167594 commit 8379748
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controllers/cloud.redhat.com/providers/database/localdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,15 @@ func (db *localDbProvider) Provide(app *crd.ClowdApp, c *config.AppConfig) error

var image string

image, ok := imageList[*(app.Spec.Database.Version)]
var dbVersion int32 = 12
if app.Spec.Database.Version != nil {
dbVersion = *(app.Spec.Database.Version)
}

image, ok := imageList[dbVersion]

if !ok {
return errors.New(fmt.Sprintf("Requested image version (%v), doesn't exist", app.Spec.Database.Version))
return errors.New(fmt.Sprintf("Requested image version (%v), doesn't exist", dbVersion))
}

if app.Spec.Cyndi.Enabled {
Expand Down

0 comments on commit 8379748

Please sign in to comment.