Skip to content
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
10 changes: 5 additions & 5 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ spec:
- name: INIT_DATABASE_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-database
- name: INIT_DATABASE_VERSION
value: 1.5.0
value: "1.5.0"
- name: DATABASE_VERSION
value: 1.5.0
value: "1.5.0"
# Ops Manager
- name: OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi
- name: INIT_OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-ops-manager
- name: INIT_OPS_MANAGER_VERSION
value: 1.5.0
value: "1.5.0"
# AppDB
- name: INIT_APPDB_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-appdb
- name: INIT_APPDB_VERSION
value: 1.5.0
value: "1.5.0"
- name: OPS_MANAGER_IMAGE_PULL_POLICY
value: Always
- name: AGENT_IMAGE
Expand Down Expand Up @@ -208,7 +208,7 @@ spec:
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:8.0.14"
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_8_0_15
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:8.0.15"
# since the official server images end with a different suffix we can re-use the same $mongodbImageEnv
# since the official server images end with a different suffix we can re-use the same $mongodbImageEnv
- name: RELATED_IMAGE_MONGODB_IMAGE_4_4_0_ubi8
value: "quay.io/mongodb/mongodb-enterprise-server:4.4.0-ubi8"
- name: RELATED_IMAGE_MONGODB_IMAGE_4_4_1_ubi8
Expand Down
10 changes: 5 additions & 5 deletions helm_chart/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,21 @@ spec:
- name: {{ $initDatabaseImageRepositoryEnv }}
value: {{ .Values.registry.initDatabase }}/{{ .Values.initDatabase.name }}
- name: INIT_DATABASE_VERSION
value: {{ $initDatabaseVersion }}
value: {{ $initDatabaseVersion | quote }}
- name: DATABASE_VERSION
value: {{ $databaseVersion }}
value: {{ $databaseVersion | quote }}
# Ops Manager
- name: {{ $opsManagerImageRepositoryEnv }}
value: {{ .Values.registry.opsManager }}/{{ .Values.opsManager.name }}
- name: {{ $initOpsManagerImageRepositoryEnv }}
value: {{ .Values.registry.initOpsManager }}/{{ .Values.initOpsManager.name }}
- name: INIT_OPS_MANAGER_VERSION
value: {{ $initOpsManagerVersion }}
value: {{ $initOpsManagerVersion | quote }}
# AppDB
- name: {{ $initAppDbImageRepositoryEnv }}
value: {{ .Values.registry.initAppDb }}/{{ .Values.initAppDb.name }}
- name: INIT_APPDB_VERSION
value: {{ $initAppDbVersion }}
value: {{ $initAppDbVersion | quote }}
- name: OPS_MANAGER_IMAGE_PULL_POLICY
value: {{ .Values.registry.pullPolicy }}
- name: {{ $agentImageEnv }}
Expand Down Expand Up @@ -260,7 +260,7 @@ spec:
- name: RELATED_IMAGE_{{ $opsManagerImageRepositoryEnv }}_{{ $version | replace "." "_" | replace "-" "_" }}
value: "{{ $.Values.registry.opsManager }}/{{ $.Values.opsManager.name }}:{{ $version }}"
{{- end }}
# since the official server images end with a different suffix we can re-use the same $mongodbImageEnv
# since the official server images end with a different suffix we can re-use the same $mongodbImageEnv
{{- range $version := .Values.relatedImages.mongodb }}
- name: RELATED_IMAGE_{{ $mongodbImageEnv }}_{{ $version | replace "." "_" | replace "-" "_" }}
value: "{{ $.Values.mongodb.repo }}/{{ $.Values.mongodb.name }}:{{ $version }}"
Expand Down
58 changes: 58 additions & 0 deletions helm_chart/tests/operator_env_vars_type_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
suite: Environment Variable Quoting Check
templates:
- operator.yaml
tests:
- it: should correctly quote the value for the env vars for container images
set:
initDatabase.version: 1234
database.version: 12d3f4
initOpsManager.version: 1.2.3
initAppDb.version: abc
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: INIT_DATABASE_VERSION
value: "1234"
- contains:
path: spec.template.spec.containers[0].env
content:
name: DATABASE_VERSION
value: "12d3f4"
- contains:
path: spec.template.spec.containers[0].env
content:
name: INIT_OPS_MANAGER_VERSION
value: "1.2.3"
- contains:
path: spec.template.spec.containers[0].env
content:
name: INIT_APPDB_VERSION
value: "abc"
- it: should correctly quote the value for the env vars for container images even when they are passed quoted
set:
initDatabase.version: "1234"
database.version: "12d3f4"
initOpsManager.version: "1.2.3"
initAppDb.version: "abc"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: INIT_DATABASE_VERSION
value: "1234"
- contains:
path: spec.template.spec.containers[0].env
content:
name: DATABASE_VERSION
value: "12d3f4"
- contains:
path: spec.template.spec.containers[0].env
content:
name: INIT_OPS_MANAGER_VERSION
value: "1.2.3"
- contains:
path: spec.template.spec.containers[0].env
content:
name: INIT_APPDB_VERSION
value: "abc"
8 changes: 4 additions & 4 deletions public/mongodb-kubernetes-multi-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -380,21 +380,21 @@ spec:
- name: INIT_DATABASE_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-database
- name: INIT_DATABASE_VERSION
value: 1.5.0
value: "1.5.0"
- name: DATABASE_VERSION
value: 1.5.0
value: "1.5.0"
# Ops Manager
- name: OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi
- name: INIT_OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-ops-manager
- name: INIT_OPS_MANAGER_VERSION
value: 1.5.0
value: "1.5.0"
# AppDB
- name: INIT_APPDB_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-appdb
- name: INIT_APPDB_VERSION
value: 1.5.0
value: "1.5.0"
- name: OPS_MANAGER_IMAGE_PULL_POLICY
value: Always
- name: AGENT_IMAGE
Expand Down
10 changes: 5 additions & 5 deletions public/mongodb-kubernetes-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -375,21 +375,21 @@ spec:
- name: INIT_DATABASE_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-database
- name: INIT_DATABASE_VERSION
value: 1.5.0
value: "1.5.0"
- name: DATABASE_VERSION
value: 1.5.0
value: "1.5.0"
# Ops Manager
- name: OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi
- name: INIT_OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-ops-manager
- name: INIT_OPS_MANAGER_VERSION
value: 1.5.0
value: "1.5.0"
# AppDB
- name: INIT_APPDB_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-appdb
- name: INIT_APPDB_VERSION
value: 1.5.0
value: "1.5.0"
- name: OPS_MANAGER_IMAGE_PULL_POLICY
value: Always
- name: AGENT_IMAGE
Expand Down Expand Up @@ -512,7 +512,7 @@ spec:
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:8.0.14"
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_8_0_15
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:8.0.15"
# since the official server images end with a different suffix we can re-use the same $mongodbImageEnv
# since the official server images end with a different suffix we can re-use the same $mongodbImageEnv
- name: RELATED_IMAGE_MONGODB_IMAGE_4_4_0_ubi8
value: "quay.io/mongodb/mongodb-enterprise-server:4.4.0-ubi8"
- name: RELATED_IMAGE_MONGODB_IMAGE_4_4_1_ubi8
Expand Down
8 changes: 4 additions & 4 deletions public/mongodb-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,21 +376,21 @@ spec:
- name: INIT_DATABASE_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-database
- name: INIT_DATABASE_VERSION
value: 1.5.0
value: "1.5.0"
- name: DATABASE_VERSION
value: 1.5.0
value: "1.5.0"
# Ops Manager
- name: OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi
- name: INIT_OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-ops-manager
- name: INIT_OPS_MANAGER_VERSION
value: 1.5.0
value: "1.5.0"
# AppDB
- name: INIT_APPDB_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-appdb
- name: INIT_APPDB_VERSION
value: 1.5.0
value: "1.5.0"
- name: OPS_MANAGER_IMAGE_PULL_POLICY
value: Always
- name: AGENT_IMAGE
Expand Down