Skip to content

Commit 72450b5

Browse files
authored
CLOUDP-364847: Remove unused MDB_IMAGE_TYPE environment variable (#641)
# Summary The `MDB_IMAGE_TYPE` environment variable was originally used by the community operator but became orphaned after the MEKO/MCO merge. The community operator now uses `MDB_COMMUNITY_IMAGE_TYPE` instead. It was used by the enterprise operator until around October 2024. Commit removing its usage: 10gen/ops-manager-kubernetes@e012718 And then, used by the community operator only. This PR removes the unused variable from: - Helm chart values and templates - Operator deployment configs - Dev and E2E test scripts - Go code (unused constant) As a follow up of this ticket, I created WRITING-34891, to come up with an engineering proposal, which will propose a proper solution for configurable UBI base image selection. Note: I added the documentation changes required in the Jira ticket, for public doc. For example we mention it here: https://www.mongodb.com/docs/kubernetes/current/reference/kubectl-operator-settings/ ## Proof of Work - Builds successfully and unit tests pass. - Public manifests regenerated via `make precommit` ## Checklist - [x] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [x] Have you added changelog file? - use `skip-changelog` label if not needed - refer to [Changelog files and Release Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes) section in CONTRIBUTING.md for more details
1 parent 3e60ddd commit 72450b5

File tree

16 files changed

+9
-30
lines changed

16 files changed

+9
-30
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
kind: other
3+
date: 2025-12-10
4+
---
5+
6+
* **Operator configuration**: Removed the unused `MDB_IMAGE_TYPE` environment variable and the corresponding `mongodb.imageType` Helm value. This variable was deprecated in v1.28.0 of the MongoDB Enterprise Kubernetes Operator when it switched to architecture-based image selection (ubi9 for static, ubi8 for non-static). This is a cleanup change with no functional impact.

config/manager/manager.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ spec:
9494
value: mongodb-enterprise-server
9595
- name: MONGODB_REPO_URL
9696
value: quay.io/mongodb
97-
- name: MDB_IMAGE_TYPE
98-
value: ubi8
9997
- name: PERFORM_FAILOVER
10098
value: 'true'
10199
- name: MDB_WEBHOOK_REGISTER_CONFIGURATION

helm_chart/templates/operator.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,6 @@ spec:
197197
value: {{ .Values.mongodb.name }}
198198
- name: MONGODB_REPO_URL
199199
value: {{ .Values.mongodb.repo }}
200-
- name: MDB_IMAGE_TYPE
201-
{{- if eq .Values.operator.mdbDefaultArchitecture "static" }}
202-
value: "ubi9"
203-
{{- else }}
204-
value: {{ .Values.mongodb.imageType }}
205-
{{- end }}
206200
{{- if eq .Values.mongodb.appdbAssumeOldFormat true }}
207201
- name: MDB_APPDB_ASSUME_OLD_FORMAT
208202
value: 'true'

helm_chart/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ mongodb:
166166
name: mongodb-enterprise-server
167167
repo: quay.io/mongodb
168168
appdbAssumeOldFormat: false
169-
imageType: ubi8
170169

171170
## Registry
172171
registry:

mongodb-community-operator/controllers/construct/mongodbstatefulset.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ var OfficialMongodbRepoUrls = []string{"docker.io/mongodb", "quay.io/mongodb"}
2828

2929
// Environment variables used to configure the MongoDB StatefulSet.
3030
const (
31-
MongodbRepoUrlEnv = "MONGODB_REPO_URL"
32-
MongodbImageEnv = "MONGODB_IMAGE"
33-
MongoDBImageTypeEnv = "MDB_IMAGE_TYPE"
34-
AgentImageEnv = "AGENT_IMAGE"
31+
MongodbRepoUrlEnv = "MONGODB_REPO_URL"
32+
MongodbImageEnv = "MONGODB_IMAGE"
33+
AgentImageEnv = "AGENT_IMAGE"
3534
)
3635

3736
// MCO only

pkg/images/Imageurls_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ func TestGetAppDBImage(t *testing.T) {
129129
want: "quay.io/mongodb/mongodb-enterprise-server:4.2.11-ubi8",
130130
setupEnvs: func(t *testing.T) {
131131
t.Setenv("RELATED_IMAGE_MONGODB_IMAGE_4_2_11_ubi8", "quay.io/mongodb/mongodb-enterprise-server:4.2.11-ubi8")
132-
t.Setenv(construct.MongoDBImageTypeEnv, "ubi8")
133132
t.Setenv(construct.MongodbImageEnv, util.DeprecatedImageAppdbUbiUrl)
134133
t.Setenv(construct.MongodbRepoUrlEnv, construct.OfficialMongodbRepoUrls[1])
135134
},
@@ -141,7 +140,6 @@ func TestGetAppDBImage(t *testing.T) {
141140
setupEnvs: func(t *testing.T) {
142141
t.Setenv("RELATED_IMAGE_MONGODB_IMAGE_4_2_11_ubi8", "quay.io/mongodb/mongodb-enterprise-server:4.2.11-ubi8")
143142
t.Setenv("RELATED_IMAGE_MONGODB_IMAGE_4_2_11_ent", "quay.io/mongodb/mongodb-enterprise-server:4.2.11-ent")
144-
t.Setenv(construct.MongoDBImageTypeEnv, "ubi8")
145143
t.Setenv(construct.MongodbImageEnv, util.OfficialEnterpriseServerImageUrl)
146144
t.Setenv(construct.MongodbRepoUrlEnv, construct.OfficialMongodbRepoUrls[1])
147145
},

public/architectures/setup-multi-cluster/ra-02-setup-operator/output/ra-02_0210_helm_install_operator.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ spec:
338338
value: mongodb-enterprise-server
339339
- name: MONGODB_REPO_URL
340340
value: quay.io/mongodb
341-
- name: MDB_IMAGE_TYPE
342-
value: ubi8
343341
- name: PERFORM_FAILOVER
344342
value: 'true'
345343
- name: MDB_MAX_CONCURRENT_RECONCILES

public/mongodb-kubernetes-multi-cluster.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,6 @@ spec:
405405
value: mongodb-enterprise-server
406406
- name: MONGODB_REPO_URL
407407
value: quay.io/mongodb
408-
- name: MDB_IMAGE_TYPE
409-
value: ubi8
410408
- name: PERFORM_FAILOVER
411409
value: 'true'
412410
- name: MDB_MAX_CONCURRENT_RECONCILES

public/mongodb-kubernetes-openshift.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,6 @@ spec:
400400
value: mongodb-enterprise-server
401401
- name: MONGODB_REPO_URL
402402
value: quay.io/mongodb
403-
- name: MDB_IMAGE_TYPE
404-
value: ubi8
405403
- name: PERFORM_FAILOVER
406404
value: 'true'
407405
- name: MDB_MAX_CONCURRENT_RECONCILES

public/mongodb-kubernetes.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,6 @@ spec:
401401
value: mongodb-enterprise-server
402402
- name: MONGODB_REPO_URL
403403
value: quay.io/mongodb
404-
- name: MDB_IMAGE_TYPE
405-
value: ubi8
406404
- name: PERFORM_FAILOVER
407405
value: 'true'
408406
- name: MDB_MAX_CONCURRENT_RECONCILES

0 commit comments

Comments
 (0)