Skip to content

CLOUDP-302383: Do not forcibly set MongoDBMajorVersion for AtlasDeployment #2349

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

Merged
merged 1 commit into from
May 26, 2025
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
fi
echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
cat "${GITHUB_OUTPUT}"

prepare-e2e:
name: Prepare E2E configuration and image
environment: release
Expand Down Expand Up @@ -77,33 +78,40 @@ jobs:
ref: ${{github.event.pull_request.head.sha}}
submodules: true
fetch-depth: 0

- name: Prepare tag
id: prepare
uses: ./.github/actions/set-tag

- name: Generate configuration for the tests
uses: ./.github/actions/gen-install-scripts
with:
IMAGE_URL: ${{ env.GHCR_REPO }}:${{ steps.prepare.outputs.tag }}
VERSION: ${{ steps.prepare.outputs.tag }}
ENV: dev

- name: Change path for the test
run: |
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

- name: Cache repo files
uses: actions/cache@v4
with:
path: |
./*
key: ${{ github.sha }}

- name: Prepare docker tag
id: prepare-docker-bundle-tag
run: |
REPOSITORY=${{ env.GHCR_BUNDLES_REPO }}
TAG=${{ steps.prepare.outputs.tag }}
TAGS="${REPOSITORY}:${TAG}"
echo "tags=$TAGS" >> $GITHUB_OUTPUT

- name: Log in to ghcr.io registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Build and Push image
uses: ./.github/actions/build-push-image
with:
Expand Down Expand Up @@ -174,13 +182,15 @@ jobs:
with:
path: ./*
key: ${{ github.sha }}

- name: Checkout if cache repo files missed
if: steps.get-repo-files-from-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha}}
submodules: true
fetch-depth: 0

- name: Install devbox
uses: jetify-com/[email protected]
with:
Expand All @@ -204,6 +214,7 @@ jobs:
- name: Change path for the test
run: |
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

- name: Create k8s Kind Cluster
if: ${{ steps.properties.outputs.k8s_platform == 'kind' && !env.ACT }}
uses: helm/[email protected]
Expand All @@ -213,16 +224,20 @@ jobs:
node_image: kindest/node:${{ steps.properties.outputs.k8s_version }}
cluster_name: ${{ matrix.test }}
wait: 180s

- name: Print kubectl version
run: |
devbox run -- 'kubectl version'

- name: Print kubectl version
run: |
devbox run -- 'kubectl version'

- name: Install CRDs if needed
if: ${{ !( matrix.test == 'helm-update' || matrix.test == 'helm-wide' || matrix.test == 'helm-ns' || matrix.test == 'bundle-test' ) }}
run: |
devbox run -- 'kubectl apply -f deploy/crds'

- name: Run e2e test
env:
MCLI_PUBLIC_API_KEY: ${{ secrets.ATLAS_PUBLIC_KEY }}
Expand Down
3 changes: 0 additions & 3 deletions internal/translation/deployment/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,6 @@ func normalizeClusterDeployment(cluster *Cluster) {
if !isTenant {
cluster.BackupEnabled = pointer.GetOrPointerToDefault(cluster.BackupEnabled, false)
cluster.PitEnabled = pointer.GetOrPointerToDefault(cluster.PitEnabled, false)
if cluster.MongoDBMajorVersion == "" {
cluster.MongoDBMajorVersion = "7.0"
}

if cluster.EncryptionAtRestProvider == "" {
cluster.EncryptionAtRestProvider = "NONE"
Expand Down
8 changes: 0 additions & 8 deletions internal/translation/deployment/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
ClusterType: "REPLICASET",
EncryptionAtRestProvider: "NONE",
MongoDBMajorVersion: "7.0",
VersionReleaseSystem: "LTS",
Paused: pointer.MakePtr(false),
PitEnabled: pointer.MakePtr(false),
Expand All @@ -436,7 +435,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
ClusterType: "REPLICASET",
EncryptionAtRestProvider: "NONE",
MongoDBMajorVersion: "7.0",
VersionReleaseSystem: "LTS",
Paused: pointer.MakePtr(false),
PitEnabled: pointer.MakePtr(false),
Expand Down Expand Up @@ -464,7 +462,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
ClusterType: "REPLICASET",
EncryptionAtRestProvider: "NONE",
MongoDBMajorVersion: "7.0",
VersionReleaseSystem: "LTS",
Paused: pointer.MakePtr(false),
PitEnabled: pointer.MakePtr(false),
Expand Down Expand Up @@ -498,7 +495,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
ClusterType: "REPLICASET",
EncryptionAtRestProvider: "NONE",
MongoDBMajorVersion: "7.0",
VersionReleaseSystem: "LTS",
Paused: pointer.MakePtr(false),
PitEnabled: pointer.MakePtr(false),
Expand Down Expand Up @@ -538,7 +534,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
ClusterType: "REPLICASET",
EncryptionAtRestProvider: "NONE",
MongoDBMajorVersion: "7.0",
VersionReleaseSystem: "LTS",
Paused: pointer.MakePtr(false),
PitEnabled: pointer.MakePtr(false),
Expand Down Expand Up @@ -590,7 +585,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
ClusterType: "REPLICASET",
EncryptionAtRestProvider: "NONE",
MongoDBMajorVersion: "7.0",
VersionReleaseSystem: "LTS",
Paused: pointer.MakePtr(false),
PitEnabled: pointer.MakePtr(false),
Expand Down Expand Up @@ -650,7 +644,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
AdvancedDeploymentSpec: &akov2.AdvancedDeploymentSpec{
ClusterType: "REPLICASET",
EncryptionAtRestProvider: "NONE",
MongoDBMajorVersion: "7.0",
VersionReleaseSystem: "LTS",
Paused: pointer.MakePtr(false),
PitEnabled: pointer.MakePtr(false),
Expand Down Expand Up @@ -733,7 +726,6 @@ func TestNormalizeClusterDeployment(t *testing.T) {
Name: "cluster0",
ClusterType: "REPLICASET",
BackupEnabled: pointer.MakePtr(false),
MongoDBMajorVersion: "7.0",
VersionReleaseSystem: "LTS",
EncryptionAtRestProvider: "NONE",
Paused: pointer.MakePtr(false),
Expand Down
Loading