[AIRFLOW-2655] Fix inconsistency of default config of kubernetes worker

Closes #3529 from mrkm4ntr/airflow-2655
This commit is contained in:
Shintaro Murakami 2018-07-04 17:48:51 +01:00 коммит произвёл Kaxil Naik
Родитель e8e7209e3a
Коммит 0523fbf004
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -19,6 +19,7 @@ import copy
import os
import six
from airflow.configuration import conf
from airflow.contrib.kubernetes.pod import Pod, Resources
from airflow.contrib.kubernetes.secret import Secret
from airflow.utils.log.logging_mixin import LoggingMixin
@ -81,7 +82,8 @@ class WorkerConfiguration(LoggingMixin):
"""Defines any necessary environment variables for the pod executor"""
env = {
'AIRFLOW__CORE__DAGS_FOLDER': '/tmp/dags',
'AIRFLOW__CORE__EXECUTOR': 'LocalExecutor'
'AIRFLOW__CORE__EXECUTOR': 'LocalExecutor',
'AIRFLOW__CORE__SQL_ALCHEMY_CONN': conf.get('core', 'SQL_ALCHEMY_CONN')
}
if self.kube_config.airflow_configmap:
env['AIRFLOW__CORE__AIRFLOW_HOME'] = self.worker_airflow_home