MongoDB Atlas Cluster Versioned Naming Strategy #66
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.
Problem
MongoDB Atlas clusters were experiencing "Duplicate resource URN" errors due to naming conflicts when different project names truncated to identical cluster names using
TrimStringMiddle. This caused deployment failures and prevented proper resource provisioning.Root Cause
The original naming logic used
util.TrimStringMiddle(projectName, 21, "--")which could produce identical cluster names for different inputs:mongodb-pool-dedicated-1→integrail---ed-1--testmongodb-pool-dedicated-2→integrail---ed-2--testSolution: Versioned Naming Strategy
🎯 Key Features
1. Backward Compatible Versioning
TrimStringMiddlebehavior for current clusters2. Cross-Stack Compatibility
namingStrategyVersionfrom server.yaml3. Conflict Resolution
mongodb-pool-dedicated-1→integrail--mongodb-3b05mongodb-pool-dedicated-2→integrail--mongodb-3b284. MongoDB Atlas Compliance
🔧 Implementation Details
Configuration Field Added
Versioned Naming Logic
Cross-Stack Export Consistency
📋 Migration Guide
For Existing Clusters (Safe)
For New Clusters (Recommended)
✅ Testing Coverage
Comprehensive Test Suite
Test Results
🛡️ Safety Guarantees
No Breaking Changes
Deployment Safety
🚀 Impact
📁 Files Modified
NamingStrategyVersionfieldThis implementation resolves the MongoDB Atlas naming conflicts while maintaining full backward compatibility and providing a clear upgrade path for existing deployments.