Skip to content

Commit

Permalink
fix(ingestion): Fix scope of .Values.globals in ingestion
Browse files Browse the repository at this point in the history
Because we're in a `range` inside `datahub-ingestion-cron`,
we can't access global values via `{{ .Values.global...`
Instead, we need `{{ $.Values...`.  Otherwise, we get
an error:

```
Error: template: datahub/charts/datahub-ingestion-cron/templates/cron.yaml:78:34: executing "datahub/charts/datahub-ingestion-cron/templates/cron.yaml" at <.Values.global.nodeSelector>: nil pointer evaluating interface {}.global
helm.go:84: [debug] template: datahub/charts/datahub-ingestion-cron/templates/cron.yaml:78:34: executing "datahub/charts/datahub-ingestion-cron/templates/cron.yaml" at <.Values.global.nodeSelector>: nil pointer evaluating interface {}.global
```

Fix so that it uses globals or the cron specific `nodeSelector`
and `tolerations` instead of triggering a nil pointer error
  • Loading branch information
Travis Cook committed Jan 10, 2024
1 parent 5366a37 commit 38577cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/datahub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies:
repository: file://./subcharts/datahub-mce-consumer
condition: global.datahub_standalone_consumers_enabled
- name: datahub-ingestion-cron
version: 0.2.140
version: 0.2.141
repository: file://./subcharts/datahub-ingestion-cron
condition: datahub-ingestion-cron.enabled
- name: acryl-datahub-actions
Expand Down
2 changes: 1 addition & 1 deletion charts/datahub/subcharts/datahub-ingestion-cron/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: A Helm chart for Kubernetes
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.2.140
version: 0.2.141
# 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: v0.11.0
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ spec:
{{- toYaml .extraSidecars | nindent 10 }}
{{- end }}
restartPolicy: {{ default "OnFailure" .restartPolicy }}
{{- with default .Values.global.nodeSelector .nodeSelector }}
{{- with default $.Values.global.nodeSelector .nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .affinity }}
affinity:
{{- toYaml .affinity | nindent 12 }}
{{- end }}
{{- with default .Values.global.tolerations .tolerations }}
{{- with default $.Values.global.tolerations .tolerations }}
tolerations:
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down

0 comments on commit 38577cf

Please sign in to comment.