diff --git a/airflow/kubernetes/pod_generator.py b/airflow/kubernetes/pod_generator.py index 211b0275ff59..cca862653ff8 100644 --- a/airflow/kubernetes/pod_generator.py +++ b/airflow/kubernetes/pod_generator.py @@ -32,7 +32,7 @@ import yaml from dateutil import parser from kubernetes.client.api_client import ApiClient -from airflow.contrib.kubernetes.pod import _extract_volume_mounts +from airflow.contrib.kubernetes.pod import _extract_volume_mounts, _extract_volumes from airflow.exceptions import AirflowConfigException from airflow.version import version as airflow_version @@ -281,7 +281,7 @@ def __init__( self.spec.affinity = affinity self.spec.service_account_name = service_account_name self.spec.init_containers = init_containers - self.spec.volumes = volumes or [] + self.spec.volumes = [v.to_k8s_client_obj() for v in _extract_volumes(volumes)] or [] self.spec.node_selector = node_selectors self.spec.restart_policy = restart_policy self.spec.priority_class_name = priority_class_name