Skip to content

Commit

Permalink
PTEUDO-1989 - Fix migration trigger check. (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrorichardtoledo authored Dec 3, 2024
1 parent afdf6b5 commit 01bf173
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/databaseclaim/databaseclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (r *DatabaseClaimReconciler) reconcileUseExistingDB(ctx context.Context, re

err = r.manageUserAndExtensions(ctx, reqInfo, logr, dbClient, &dbClaim.Status.NewDB, dbName, dbClaim.Spec.Username, operationalMode)
if err != nil {
logr.Error(err, "unable to update users, user credents not persisted to status object")
logr.Error(err, "unable to update users, user credentials not persisted to status object")
return err
}
if err = r.updateClientStatus(ctx, dbClaim); err != nil {
Expand Down
7 changes: 3 additions & 4 deletions pkg/hostparams/hostparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,10 @@ func New(config *viper.Viper, dbClaim *v1.DatabaseClaim) (*HostParams, error) {
}

if hostParams.DBVersion == "" {
if dbClaim.Status.ActiveDB.DBVersion != "" {
//for an existing (Status.ActiveDB NOT empty) it picks up the Status DBVersion, so no update is triggered.
if dbClaim.Spec.UseExistingSource != nil && *dbClaim.Spec.UseExistingSource {
hostParams.DBVersion = dbClaim.Status.ActiveDB.DBVersion
} else {
//for a new Claim (Status.ActiveDB empty) it assumes 15 only
}
if hostParams.DBVersion == "" {
hostParams.IsDefaultVersion = true
hostParams.DBVersion = defaultMajorVersion
}
Expand Down

0 comments on commit 01bf173

Please sign in to comment.