ashb commented on a change in pull request #6230: [AIRFLOW-5413] Allow K8S
worker pod to be configured from JSON/YAML file
URL: https://github.com/apache/airflow/pull/6230#discussion_r357555699
##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -402,22 +405,30 @@ def run_next(self, next_job: KubernetesJobType) -> None:
status
"""
self.log.info('Kubernetes job is %s', str(next_job))
+
key, command, kube_executor_config = next_job
dag_id, task_id, execution_date, try_number = key
- config_pod = self.worker_configuration.make_pod(
- namespace=self.namespace,
- worker_uuid=self.worker_uuid,
- pod_id=self._create_pod_id(dag_id, task_id),
- dag_id=self._make_safe_label_value(dag_id),
- task_id=self._make_safe_label_value(task_id),
+ safe_dag_id = AirflowKubernetesScheduler._make_safe_label_value(dag_id)
+ safe_task_id =
AirflowKubernetesScheduler._make_safe_label_value(task_id)
+ safe_date =
AirflowKubernetesScheduler._datetime_to_label_safe_datestring(execution_date)
+ safe_pod_id = AirflowKubernetesScheduler._create_pod_id(dag_id,
task_id)
+
+ if isinstance(command, str):
+ command = [command]
+
+ pod = PodGenerator.construct_pod(
+ dag_id=safe_dag_id,
+ task_id=safe_task_id,
Review comment:
50/50. Probably clearer from a git history point-of-view if it's a separate
PR.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services