Repository: incubator-airflow Updated Branches: refs/heads/master 7255589f9 -> ef3ead167
[AIRFLOW-2611] Fix wrong dag volume mount path for kubernetes executor There are two way of syncing dags, pvc and git- sync, if set both (dags_volume_claim and git_subpath), I won't get the mountPath what I want. I think the priority of pvc should higher than git-sync, so I think when dags_volume_claim is been set, the mountPath shuold not join the git_subpath. Closes #3497 from imroc/AIRFLOW-2611 Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/ef3ead16 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/ef3ead16 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/ef3ead16 Branch: refs/heads/master Commit: ef3ead167be9d7dd72f75da9d1f4e00438b8ea6e Parents: 7255589 Author: roc <[email protected]> Authored: Fri Jun 15 21:15:02 2018 +0100 Committer: Kaxil Naik <[email protected]> Committed: Fri Jun 15 21:15:02 2018 +0100 ---------------------------------------------------------------------- airflow/contrib/kubernetes/worker_configuration.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/ef3ead16/airflow/contrib/kubernetes/worker_configuration.py ---------------------------------------------------------------------- diff --git a/airflow/contrib/kubernetes/worker_configuration.py b/airflow/contrib/kubernetes/worker_configuration.py index 3ac830d..2654085 100644 --- a/airflow/contrib/kubernetes/worker_configuration.py +++ b/airflow/contrib/kubernetes/worker_configuration.py @@ -132,12 +132,19 @@ class WorkerConfiguration(LoggingMixin): self.kube_config.logs_volume_subpath ) ] - volume_mounts = [{ - 'name': dags_volume_name, - 'mountPath': os.path.join( + + dag_volume_mount_path = "" + if self.kube_config.dags_volume_claim: + dag_volume_mount_path = self.worker_airflow_dags + else: + dag_volume_mount_path = os.path.join( self.worker_airflow_dags, self.kube_config.git_subpath - ), + ) + + volume_mounts = [{ + 'name': dags_volume_name, + 'mountPath': dag_volume_mount_path, 'readOnly': True }, { 'name': logs_volume_name,
