Skip to content

Commit

Permalink
fix/postMigration-at-userExisting
Browse files Browse the repository at this point in the history
  • Loading branch information
abodhekar committed Nov 16, 2023
1 parent 8261f24 commit 60b440e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions controllers/databaseclaim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,13 +843,14 @@ loop:
}
dbClaim.Status.MigrationState = pgctl.S_Completed.String()

timenow := metav1.Now()

dbClaim.Status.OldDB = persistancev1.StatusForOldDB{ConnectionInfo: &persistancev1.DatabaseClaimConnectionInfo{}}
//dbClaim.Status.OldDB = *dbClaim.Status.ActiveDB.DeepCopy()
MakeDeepCopyToOldDB(&dbClaim.Status.OldDB, &dbClaim.Status.ActiveDB)
dbClaim.Status.OldDB.DbState = persistancev1.PostMigrationInProgress
dbClaim.Status.OldDB.PostMigrationActionStartedAt = &timenow
if dbClaim.Status.ActiveDB.DbState != persistancev1.UsingExistingDB {
timenow := metav1.Now()
dbClaim.Status.OldDB = persistancev1.StatusForOldDB{ConnectionInfo: &persistancev1.DatabaseClaimConnectionInfo{}}
//dbClaim.Status.OldDB = *dbClaim.Status.ActiveDB.DeepCopy()
MakeDeepCopyToOldDB(&dbClaim.Status.OldDB, &dbClaim.Status.ActiveDB)
dbClaim.Status.OldDB.DbState = persistancev1.PostMigrationInProgress
dbClaim.Status.OldDB.PostMigrationActionStartedAt = &timenow
}

//done with migration- switch active server to newDB
dbClaim.Status.ActiveDB = *dbClaim.Status.NewDB.DeepCopy()
Expand Down

0 comments on commit 60b440e

Please sign in to comment.