commitUpgrade is the upgrade CLI phase that commits the upgrade and removes the lock after the actual upgrade phase has been run successfully. We will not end up here if any of the prior phases have failed. This will also cleanup and backups used for the rollback mechanism, so we cannot rollback aft
(ctx context.Context, rep repo.DirectRepositoryWriter)
| 484 | // cleanup and backups used for the rollback mechanism, so we cannot rollback |
| 485 | // after this phase. |
| 486 | func (c *commandRepositoryUpgrade) commitUpgrade(ctx context.Context, rep repo.DirectRepositoryWriter) error { |
| 487 | if c.commitMode == commitModeNeverCommit { |
| 488 | log(ctx).Info("Commit mode is set to 'never'. Skipping commit.") |
| 489 | return nil |
| 490 | } |
| 491 | |
| 492 | if err := rep.FormatManager().CommitUpgrade(ctx); err != nil { |
| 493 | return errors.Wrap(err, "error finalizing upgrade") |
| 494 | } |
| 495 | // we need to reopen the repository after this point |
| 496 | |
| 497 | log(ctx).Info("Repository has been successfully upgraded.") |
| 498 | |
| 499 | return nil |
| 500 | } |
nothing calls this directly
no test coverage detected