Skip to content

Commit 1cf4211

Browse files
Do not default MongoDBMajorVersion to 7.0 for AtlasDeployment (#2349)
1 parent 21afe33 commit 1cf4211

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.github/workflows/test-e2e.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
fi
2222
echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
2323
cat "${GITHUB_OUTPUT}"
24+
2425
prepare-e2e:
2526
name: Prepare E2E configuration and image
2627
environment: release
@@ -77,33 +78,40 @@ jobs:
7778
ref: ${{github.event.pull_request.head.sha}}
7879
submodules: true
7980
fetch-depth: 0
81+
8082
- name: Prepare tag
8183
id: prepare
8284
uses: ./.github/actions/set-tag
85+
8386
- name: Generate configuration for the tests
8487
uses: ./.github/actions/gen-install-scripts
8588
with:
8689
IMAGE_URL: ${{ env.GHCR_REPO }}:${{ steps.prepare.outputs.tag }}
8790
VERSION: ${{ steps.prepare.outputs.tag }}
8891
ENV: dev
92+
8993
- name: Change path for the test
9094
run: |
9195
awk '{gsub(/cloud.mongodb.com/, "cloud-qa.mongodb.com", $0); print}' bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml > tmp && mv tmp bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
96+
9297
- name: Cache repo files
9398
uses: actions/cache@v4
9499
with:
95100
path: |
96101
./*
97102
key: ${{ github.sha }}
103+
98104
- name: Prepare docker tag
99105
id: prepare-docker-bundle-tag
100106
run: |
101107
REPOSITORY=${{ env.GHCR_BUNDLES_REPO }}
102108
TAG=${{ steps.prepare.outputs.tag }}
103109
TAGS="${REPOSITORY}:${TAG}"
104110
echo "tags=$TAGS" >> $GITHUB_OUTPUT
111+
105112
- name: Log in to ghcr.io registry
106113
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
114+
107115
- name: Build and Push image
108116
uses: ./.github/actions/build-push-image
109117
with:
@@ -174,13 +182,15 @@ jobs:
174182
with:
175183
path: ./*
176184
key: ${{ github.sha }}
185+
177186
- name: Checkout if cache repo files missed
178187
if: steps.get-repo-files-from-cache.outputs.cache-hit != 'true'
179188
uses: actions/checkout@v4
180189
with:
181190
ref: ${{github.event.pull_request.head.sha}}
182191
submodules: true
183192
fetch-depth: 0
193+
184194
- name: Install devbox
185195
uses: jetify-com/[email protected]
186196
with:
@@ -204,6 +214,7 @@ jobs:
204214
- name: Change path for the test
205215
run: |
206216
awk '{gsub(/cloud.mongodb.com/, "cloud-qa.mongodb.com", $0); print}' bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml > tmp && mv tmp bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
217+
207218
- name: Create k8s Kind Cluster
208219
if: ${{ steps.properties.outputs.k8s_platform == 'kind' && !env.ACT }}
209220
uses: helm/[email protected]
@@ -213,16 +224,20 @@ jobs:
213224
node_image: kindest/node:${{ steps.properties.outputs.k8s_version }}
214225
cluster_name: ${{ matrix.test }}
215226
wait: 180s
227+
216228
- name: Print kubectl version
217229
run: |
218230
devbox run -- 'kubectl version'
231+
219232
- name: Print kubectl version
220233
run: |
221234
devbox run -- 'kubectl version'
235+
222236
- name: Install CRDs if needed
223237
if: ${{ !( matrix.test == 'helm-update' || matrix.test == 'helm-wide' || matrix.test == 'helm-ns' || matrix.test == 'bundle-test' ) }}
224238
run: |
225239
devbox run -- 'kubectl apply -f deploy/crds'
240+
226241
- name: Run e2e test
227242
env:
228243
MCLI_PUBLIC_API_KEY: ${{ secrets.ATLAS_PUBLIC_KEY }}

internal/translation/deployment/conversion.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,6 @@ func normalizeClusterDeployment(cluster *Cluster) {
328328
if !isTenant {
329329
cluster.BackupEnabled = pointer.GetOrPointerToDefault(cluster.BackupEnabled, false)
330330
cluster.PitEnabled = pointer.GetOrPointerToDefault(cluster.PitEnabled, false)
331-
if cluster.MongoDBMajorVersion == "" {
332-
cluster.MongoDBMajorVersion = "7.0"
333-
}
334331

335332
if cluster.EncryptionAtRestProvider == "" {
336333
cluster.EncryptionAtRestProvider = "NONE"

internal/translation/deployment/conversion_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
412412
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
413413
ClusterType: "REPLICASET",
414414
EncryptionAtRestProvider: "NONE",
415-
MongoDBMajorVersion: "7.0",
416415
VersionReleaseSystem: "LTS",
417416
Paused: pointer.MakePtr(false),
418417
PitEnabled: pointer.MakePtr(false),
@@ -436,7 +435,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
436435
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
437436
ClusterType: "REPLICASET",
438437
EncryptionAtRestProvider: "NONE",
439-
MongoDBMajorVersion: "7.0",
440438
VersionReleaseSystem: "LTS",
441439
Paused: pointer.MakePtr(false),
442440
PitEnabled: pointer.MakePtr(false),
@@ -464,7 +462,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
464462
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
465463
ClusterType: "REPLICASET",
466464
EncryptionAtRestProvider: "NONE",
467-
MongoDBMajorVersion: "7.0",
468465
VersionReleaseSystem: "LTS",
469466
Paused: pointer.MakePtr(false),
470467
PitEnabled: pointer.MakePtr(false),
@@ -498,7 +495,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
498495
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
499496
ClusterType: "REPLICASET",
500497
EncryptionAtRestProvider: "NONE",
501-
MongoDBMajorVersion: "7.0",
502498
VersionReleaseSystem: "LTS",
503499
Paused: pointer.MakePtr(false),
504500
PitEnabled: pointer.MakePtr(false),
@@ -538,7 +534,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
538534
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
539535
ClusterType: "REPLICASET",
540536
EncryptionAtRestProvider: "NONE",
541-
MongoDBMajorVersion: "7.0",
542537
VersionReleaseSystem: "LTS",
543538
Paused: pointer.MakePtr(false),
544539
PitEnabled: pointer.MakePtr(false),
@@ -590,7 +585,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
590585
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
591586
ClusterType: "REPLICASET",
592587
EncryptionAtRestProvider: "NONE",
593-
MongoDBMajorVersion: "7.0",
594588
VersionReleaseSystem: "LTS",
595589
Paused: pointer.MakePtr(false),
596590
PitEnabled: pointer.MakePtr(false),
@@ -650,7 +644,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
650644
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
651645
ClusterType: "REPLICASET",
652646
EncryptionAtRestProvider: "NONE",
653-
MongoDBMajorVersion: "7.0",
654647
VersionReleaseSystem: "LTS",
655648
Paused: pointer.MakePtr(false),
656649
PitEnabled: pointer.MakePtr(false),
@@ -733,7 +726,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
733726
Name: "cluster0",
734727
ClusterType: "REPLICASET",
735728
BackupEnabled: pointer.MakePtr(false),
736-
MongoDBMajorVersion: "7.0",
737729
VersionReleaseSystem: "LTS",
738730
EncryptionAtRestProvider: "NONE",
739731
Paused: pointer.MakePtr(false),

0 commit comments

Comments
 (0)