Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch] Mongo remove upgrade assert #793

Merged
merged 7 commits into from Feb 21, 2024
Merged

Conversation

andrercm
Copy link
Contributor

@andrercm andrercm commented Feb 19, 2024

This PR fixes a problem where we were expecting --mongo-v5-upgrade to be passed in when using --no-confirm flag even if the Mongo was already upgraded to v5. The condition to enforce --mongo-v5-upgrade is now inside the parent condition that checks if MongoDB version needs upgrading.

Tests to prove it's working well now:

1. Upgrade Mongo v4 to v5

Interactive mode, warning will still be shown to let users know about the upgrade:
image

Non-interactive with --no-confirm - it must fail as --mongo-v5-upgrade was not set:

image

Non-interactive with --no-confirm --mongo-v5-upgrade - it must install update pipeline directly:

image

2. Upgrade Mongo v5 to v5:

Interactive mode - no warning as no update needed:
image

Non-interactive with --no-confirm - it must NOT ask for --mongo-v5-upgrade as no update needed:

image
  • Also added an assert to fail early and do not allow Mongo downgrades (currently it's already prevented in ansible-devops but we don't want to get there to fail):

@andrercm andrercm marked this pull request as ready for review February 19, 2024 18:15
@whitfiea whitfiea merged commit d712b67 into master Feb 21, 2024
2 checks passed
@whitfiea whitfiea deleted the mongo-remove-upgrade-assert branch February 21, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants