Skip to content

Commit

Permalink
fix(cd-service): make sure environment applications list gets updated…
Browse files Browse the repository at this point in the history
… during custom migrations (#2003)

Ref: SRX-GJNPF1
  • Loading branch information
AminSlk authored Oct 2, 2024
1 parent 0ddd272 commit 2d7a508
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -1635,10 +1635,6 @@ func (h *DBHandler) RunCustomMigrations(
if err != nil {
return err // better wrap the error in a descriptive message?
}
err = h.RunCustomMigrationEnvironmentApplications(ctx)
if err != nil {
return err
}
return nil
}

Expand Down
5 changes: 5 additions & 0 deletions services/cd-service/pkg/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ func RunServer() {
logger.FromContext(ctx).Fatal("Error running custom database migrations", zap.Error(err))
}
logger.FromContext(ctx).Sugar().Warnf("Skipping custom migrations, because all tables contain data.")
err = dbHandler.RunCustomMigrationEnvironmentApplications(ctx)
if err != nil {
return err
}
logger.FromContext(ctx).Sugar().Warnf("Applied custom migrations for environment applications")
} else {
logger.FromContext(ctx).Sugar().Warnf("Skipping custom migrations, because KUBERPULT_DB_WRITE_ESL_TABLE_ONLY=false")
}
Expand Down

0 comments on commit 2d7a508

Please sign in to comment.