Skip to content

Commit

Permalink
add "Release" to template context dict (#121)
Browse files Browse the repository at this point in the history
* add missing "Release" context where "airflow.volumes" is included

Signed-off-by: Yuan Gao <[email protected]>

* add "Release" context to other template usage

Signed-off-by: Mathew Wicks <[email protected]>
  • Loading branch information
meseta authored Apr 5, 2021
1 parent dec1f10 commit 65d850e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion charts/airflow/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: airflow is a platform to programmatically author, schedule, and monitor workflows
name: airflow
version: 8.0.3
version: 8.0.4
appVersion: 2.0.1
icon: https://airflow.apache.org/_images/pin_large.png
home: https://airflow.apache.org/
Expand Down
8 changes: 4 additions & 4 deletions charts/airflow/files/pod_template.kubernetes-helm-yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ spec:
{{- if or ($extraPipPackages) (.Values.dags.gitSync.enabled) }}
initContainers:
{{- if $extraPipPackages }}
{{- include "airflow.init_container.install_pip_packages" (dict "Values" .Values "extraPipPackages" $extraPipPackages) | indent 4 }}
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 4 }}
{{- end }}
{{- include "airflow.container.git_sync" (dict "Values" .Values "sync_one_time" "true") | indent 4 }}
{{- include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") | indent 4 }}
{{- end }}
containers:
- name: base
Expand All @@ -56,13 +56,13 @@ spec:
command: []
args: []
{{- $extraVolumeMounts := .Values.airflow.kubernetesPodTemplate.extraVolumeMounts }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
{{- if $volumeMounts }}
volumeMounts:
{{- $volumeMounts | indent 8 }}
{{- end }}
{{- $extraVolumes := .Values.airflow.kubernetesPodTemplate.extraVolumes }}
{{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
{{- $volumes := include "airflow.volumes" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
{{- if $volumes }}
volumes:
{{- $volumes | indent 4 }}
Expand Down
8 changes: 4 additions & 4 deletions charts/airflow/templates/_helpers/pods.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Define an init-container which waits for DB migrations

{{/*
Define an init-container which installs a list of pip packages
EXAMPLE USAGE: {{ include "airflow.init_container.install_pip_packages" (dict "Values" .Values "extraPipPackages" $extraPipPackages) }}
EXAMPLE USAGE: {{ include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) }}
*/}}
{{- define "airflow.init_container.install_pip_packages" }}
- name: install-pip-packages
Expand All @@ -81,7 +81,7 @@ EXAMPLE USAGE: {{ include "airflow.init_container.install_pip_packages" (dict "V

{{/*
Define a container which regularly syncs a git-repo
EXAMPLE USAGE: {{ include "airflow.container.git_sync" (dict "Values" .Values "sync_one_time" "true") }}
EXAMPLE USAGE: {{ include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") }}
*/}}
{{- define "airflow.container.git_sync" }}
- name: dags-git-sync
Expand Down Expand Up @@ -161,7 +161,7 @@ EXAMPLE USAGE: {{ include "airflow.container.git_sync" (dict "Values" .Values "s

{{/*
The list of `volumeMounts` for web/scheduler/worker/flower container
EXAMPLE USAGE: {{ include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
EXAMPLE USAGE: {{ include "airflow.volumeMounts" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
*/}}
{{- define "airflow.volumeMounts" }}
{{- /* dags */ -}}
Expand Down Expand Up @@ -200,7 +200,7 @@ EXAMPLE USAGE: {{ include "airflow.volumeMounts" (dict "Values" .Values "extraPi

{{/*
The list of `volumes` for web/scheduler/worker/flower Pods
EXAMPLE USAGE: {{ include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
EXAMPLE USAGE: {{ include "airflow.volumes" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
*/}}
{{- define "airflow.volumes" }}
{{- /* dags */ -}}
Expand Down
6 changes: 3 additions & 3 deletions charts/airflow/templates/flower/flower-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
{{- end }}
initContainers:
{{- if $extraPipPackages }}
{{- include "airflow.init_container.install_pip_packages" (dict "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
{{- end }}
{{- include "airflow.init_container.check_db" . | indent 8 }}
{{- include "airflow.init_container.wait_for_db_migrations" . | indent 8 }}
Expand Down Expand Up @@ -151,13 +151,13 @@ spec:
{{- end }}
{{- end }}
{{- $extraVolumeMounts := .Values.flower.extraVolumeMounts }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
{{- if $volumeMounts }}
volumeMounts:
{{- $volumeMounts | indent 12 }}
{{- end }}
{{- $extraVolumes := .Values.flower.extraVolumes }}
{{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
{{- $volumes := include "airflow.volumes" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
{{- if $volumes }}
volumes:
{{- $volumes | indent 8 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/airflow/templates/scheduler/scheduler-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
serviceAccountName: {{ include "airflow.serviceAccountName" . }}
initContainers:
{{- if $extraPipPackages }}
{{- include "airflow.init_container.install_pip_packages" (dict "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
{{- end }}
{{- include "airflow.init_container.check_db" . | indent 8 }}
{{- include "airflow.init_container.wait_for_db_migrations" . | indent 8 }}
Expand Down Expand Up @@ -138,7 +138,7 @@ spec:
SystemExit(f"UNHEALTHY - {count_alive_jobs} (more than 1) alive SchedulerJob for: {hostname}")
{{- end }}
{{- $extraVolumeMounts := .Values.scheduler.extraVolumeMounts }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
{{- if or ($volumeMounts) (include "airflow.executor.kubernetes_like" .) }}
volumeMounts:
{{- $volumeMounts | indent 12 }}
Expand All @@ -156,7 +156,7 @@ spec:
{{- toYaml .Values.airflow.extraContainers | nindent 8 }}
{{- end }}
{{- $extraVolumes := .Values.scheduler.extraVolumes }}
{{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
{{- $volumes := include "airflow.volumes" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
{{- if or ($volumes) (include "airflow.executor.kubernetes_like" .) }}
volumes:
{{- $volumes | indent 8 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/airflow/templates/webserver/webserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
{{- end }}
initContainers:
{{- if $extraPipPackages }}
{{- include "airflow.init_container.install_pip_packages" (dict "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
{{- end }}
{{- include "airflow.init_container.check_db" . | indent 8 }}
{{- include "airflow.init_container.wait_for_db_migrations" . | indent 8 }}
Expand Down Expand Up @@ -126,7 +126,7 @@ spec:
port: web
{{- end }}
{{- $extraVolumeMounts := .Values.web.extraVolumeMounts }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
volumeMounts:
{{- $volumeMounts | indent 12 }}
- name: webserver-config
Expand All @@ -140,7 +140,7 @@ spec:
{{- toYaml .Values.airflow.extraContainers | nindent 8 }}
{{- end }}
{{- $extraVolumes := .Values.web.extraVolumes }}
{{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
{{- $volumes := include "airflow.volumes" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
volumes:
{{- $volumes | indent 8 }}
- name: webserver-config
Expand Down
6 changes: 3 additions & 3 deletions charts/airflow/templates/worker/worker-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ spec:
{{- end }}
initContainers:
{{- if $extraPipPackages }}
{{- include "airflow.init_container.install_pip_packages" (dict "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
{{- end }}
{{- include "airflow.init_container.check_db" . | indent 8 }}
{{- include "airflow.init_container.wait_for_db_migrations" . | indent 8 }}
Expand Down Expand Up @@ -155,7 +155,7 @@ spec:
- "exec airflow celery worker"
{{- end }}
{{- $extraVolumeMounts := .Values.workers.extraVolumeMounts }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
{{- $volumeMounts := include "airflow.volumeMounts" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }}
{{- if $volumeMounts }}
volumeMounts:
{{- $volumeMounts | indent 12 }}
Expand All @@ -167,7 +167,7 @@ spec:
{{- toYaml .Values.airflow.extraContainers | nindent 8 }}
{{- end }}
{{- $extraVolumes := .Values.workers.extraVolumes }}
{{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
{{- $volumes := include "airflow.volumes" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }}
{{- if $volumes }}
volumes:
{{- $volumes | indent 8 }}
Expand Down

0 comments on commit 65d850e

Please sign in to comment.