Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions controllers/manageddatabase_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,19 @@ func (c *ManagedDatabaseController) reconcileMigrationJob(oneMigration migration
for _, job := range jobsForDatabase.Items {
if job.Labels["migration-uid"] == string(oneMigration.version.UID) {
// This is the job for the migration in question
oneMigration.log.Info("Found matching migration")
oneMigration.log.Info("Found matching migration job")
foundJob = true

if job.Status.Succeeded > 0 {
oneMigration.log.Info("Migration is complete")
oneMigration.log.Info("Migration job is complete")

// TODO: should we write the metric here or wait until cleanup?
} else if job.Status.Active == 0 && job.Status.Conditions != nil {
for _, condition := range job.Status.Conditions {
if condition.Type == "Failed" && condition.Status == "True" {
return fmt.Errorf("Migration job failed to complete (%s)", job.Name)
}
}
}
} else {
// This is an old job and should be cleaned up
Expand Down