Skip to content

Commit

Permalink
fix(template-mcp): updates for template-mcps (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored Oct 9, 2024
1 parent 37d86c3 commit e7a3562
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/datahub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A Helm chart for DataHub
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.4.28
version: 0.4.29
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.14.1
Expand Down
8 changes: 6 additions & 2 deletions charts/datahub/templates/datahub-upgrade/_upgrade.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ Return the env variables for upgrade jobs
{{- else -}}
{{- $range = sub $end $start -}}
{{- end -}}
{{- $seed := now | unixEpoch -}}
{{- /* Generate a seed using a combination of methods */ -}}
{{- $randomString := randAlphaNum 32 -}}
{{- $checksum := adler32sum $randomString -}}
{{- $currentTime := now | unixEpoch -}}
{{- $seed := add (mod (mul $checksum 65537) 1000000) (mod $currentTime 1000000) -}}
{{- $randomOffset := mod $seed (add $range 1) -}}
{{- mod (add $start $randomOffset) 24 -}}
{{- end -}}
Expand All @@ -193,7 +197,7 @@ schedule:
interval: {{ printf "%d %s * * * " (mod (randNumeric 2) 60) (include "randomHourInRange" (list .Values.datahubSystemUpdate.bootstrapMCPs.datahubGC.dailyCronWindow.startHour .Values.datahubSystemUpdate.bootstrapMCPs.datahubGC.dailyCronWindow.endHour)) }}
{{- else }}
schedule:
interval: {{ .Values.datahubSystemUpdate.bootstrapMCPs.datahubGC.values.schedule.interval | quote }}
interval: {{ .Values.datahubSystemUpdate.bootstrapMCPs.datahubGC.values.schedule.interval | quote }}
{{- end }}
{{- end -}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ spec:
- name: ELASTICSEARCH_BUILD_INDICES_ALLOW_DOC_COUNT_MISMATCH
value: {{ . | quote }}
{{- end }}
{{- range $k, $v := .Values.datahubSystemUpdate.bootstrapMCPs }}
{{- $result := deepCopy $v.values }}
{{- range $v.values_generated_configs }}
{{- $funcOutput := include . $ | fromYaml }}
{{- $result = include "deepMerge" (dict "dst" $result "src" $funcOutput) | fromYaml }}
{{- end }}
- name: {{ $v.values_env }}
value: {{ $result | toJson | quote }}
{{- end }}
{{- with .Values.datahubSystemUpdate.extraEnvs }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -297,8 +306,7 @@ spec:
value: {{ . | quote }}
{{- end }}
{{- range $k, $v := .Values.datahubSystemUpdate.bootstrapMCPs }}
{{- $result := dict }}
{{- $result = merge $result $v.values }}
{{- $result := deepCopy $v.values }}
{{- range $v.values_generated_configs }}
{{- $funcOutput := include . $ | fromYaml }}
{{- $result = include "deepMerge" (dict "dst" $result "src" $funcOutput) | fromYaml }}
Expand Down

0 comments on commit e7a3562

Please sign in to comment.