Skip to content

Commit c682b43

Browse files
committed
fixes for render checks
1 parent 4abae7e commit c682b43

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

charts/countly-migration/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Bundled mode: construct from sibling countly-mongodb chart DNS.
101101
{{- $host := $bs.host | default (printf "%s-mongodb-svc.%s.svc.cluster.local" $prefix ($bs.namespace | default "mongodb")) -}}
102102
{{- $port := $bs.port | default "27017" -}}
103103
{{- $user := $bs.username | default "app" -}}
104-
{{- $pass := required "backingServices.mongodb.password is required when mode=bundled" $bs.password -}}
104+
{{- $pass := $bs.password | default "" -}}
105105
{{- $db := $bs.database | default "admin" -}}
106106
{{- $rs := $bs.replicaSet | default (printf "%s-mongodb" $prefix) -}}
107107
mongodb://{{ $user }}:{{ $pass }}@{{ $host }}:{{ $port }}/{{ $db }}?replicaSet={{ $rs }}&ssl=false

charts/countly-migration/templates/secret.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ type: Opaque
1616
data:
1717
{{- $secretName := include "countly-migration.fullname" . }}
1818
{{- $existing := lookup "v1" "Secret" .Release.Namespace $secretName }}
19+
{{- if and (not .Values.backingServices.mongodb.password) (eq (.Values.backingServices.mongodb.mode | default "bundled") "bundled") }}
20+
{{- if and $existing (index $existing.data "MONGO_URI") }}
21+
MONGO_URI: {{ index $existing.data "MONGO_URI" }}
22+
{{- else }}
23+
{{- fail "backingServices.mongodb.password is required on first install when mode=bundled. Set the value or provide secrets.existingSecret." }}
24+
{{- end }}
25+
{{- else }}
1926
MONGO_URI: {{ include "countly-migration.mongoUri" . | b64enc }}
27+
{{- end }}
2028
CLICKHOUSE_URL: {{ include "countly-migration.clickhouseUrl" . | b64enc }}
2129
{{- if .Values.backingServices.clickhouse.password }}
2230
CLICKHOUSE_PASSWORD: {{ .Values.backingServices.clickhouse.password | b64enc }}

0 commit comments

Comments
 (0)