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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
that: "existing_mongo_version is version_compare(target_mongodb_version, '<=')"
fail_msg: "Mongo downgrade is not allowed! Current mongo version: {{ existing_mongo_version }}, target mongo version {{ target_mongodb_version }}"

# For users installed or upgraded to mongo v4.4 using old CLI didn't have featureCompatibilityVersion set correctly.
- name: Assert featureCompatibilityVersion is present and equal to existing version.
assert:
that:
- existing_mongodb.resources[0].spec.featureCompatibilityVersion is defined and existing_mongodb.resources[0].spec.featureCompatibilityVersion != ""
- existing_mongodb.resources[0].spec.featureCompatibilityVersion == existing_mongo_minor_version
fail_msg: "Mongo upgrade is not allowed due to either missing featureCompatibilityVersion field or wrong version in featureCompatibilityVersion field in MongoDBCommunity CR"
when: mongodb_v5_upgrade or mongodb_v6_upgrade or mongodb_v7_upgrade


# Only allow Mongo upgrades to be next compatible minor version
- name: "Assert Mongo upgrade compatibility: {{ target_mongodb_version }} must be in {{ mongo_compatible_target_version[existing_mongo_version] }}"
when: existing_mongo_minor_version != '4.2' # will skip this assertion if mongo v4.2 as we'll assist in the auto upgrade to v4.4 and v5 in a single run
Expand Down
Loading