fix: preserve api mongo_db_major_version on real upgrades#4399
Closed
mkusaka wants to merge 1 commit intomongodb:masterfrom
Closed
fix: preserve api mongo_db_major_version on real upgrades#4399mkusaka wants to merge 1 commit intomongodb:masterfrom
mkusaka wants to merge 1 commit intomongodb:masterfrom
Conversation
13 tasks
Collaborator
|
Closing in favor of #4400, to follow our Merging Guidelines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This narrows the
mongo_db_major_versioncompatibility workaround inmongodbatlas_advanced_clusterso it only preserves the previous state value when the difference is formatting-only, for example8vs8.0.When Atlas API returns a genuinely different major version, such as
7.0 -> 8.0after an out-of-band upgrade and FCV unpin, the provider now keeps the API value instead of forcing the previous state value back into state.This preserves the original intent of avoiding unnecessary diffs from version normalization while allowing real major-version transitions to converge.
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments
Added a unit test that covers both:
8, API value8.07.0, API value8.0Validation run:
go test ./internal/service/advancedcluster -run '^TestOverrideAttributesWithPrevStateValueMongoDBMajorVersion$'go test ./internal/service/advancedcluster -run 'TestPlanChecksClusterTwoRepSpecsWithAutoScalingAndSpecs'