Skip to content

Commit

Permalink
fix: support rbd-app-ui sqlite
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Zhang <[email protected]>
  • Loading branch information
zzzhangqi committed Oct 28, 2024
1 parent 9e403d0 commit 5d2e307
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions controllers/handler/app-ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 7,7 @@ import (
"strconv"

rainbondv1alpha1 "github.com/goodrain/rainbond-operator/api/v1alpha1"
checksqllite "github.com/goodrain/rainbond-operator/util/check-sqllite"
"github.com/goodrain/rainbond-operator/util/commonutil"
"github.com/goodrain/rainbond-operator/util/probeutil"
"github.com/goodrain/rainbond-operator/util/rbdutil"
Expand Down Expand Up @@ -46,17 47,18 @@ func NewAppUI(ctx context.Context, client client.Client, component *rainbondv1al
}

func (a *appui) Before() error {
db, err := getDefaultDBInfo(a.ctx, a.client, a.cluster.Spec.UIDatabase, a.component.Namespace, DBName)
if err != nil {
return fmt.Errorf("get db info: %v", err)
}
if db.Name == "" {
db.Name = ConsoleDatabaseName
}
a.db = db

if err := isUIDBReady(a.ctx, a.client, a.component, a.cluster); err != nil {
return err
if !checksqllite.IsSQLLite() {
db, err := getDefaultDBInfo(a.ctx, a.client, a.cluster.Spec.UIDatabase, a.component.Namespace, DBName)
if err != nil {
return fmt.Errorf("get db info: %v", err)
}
if db.Name == "" {
db.Name = ConsoleDatabaseName
}
a.db = db
if err := isUIDBReady(a.ctx, a.client, a.component, a.cluster); err != nil {
return err
}
}

if a.cluster.Spec.ImageHub == nil {
Expand Down

0 comments on commit 5d2e307

Please sign in to comment.