kaxil commented on a change in pull request #7507: [AIRFLOW-6885] Delete worker
on success
URL: https://github.com/apache/airflow/pull/7507#discussion_r382946207
##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -848,10 +850,13 @@ def sync(self) -> None:
def _change_state(self, key: TaskInstanceKeyType, state: Optional[str],
pod_id: str) -> None:
if state != State.RUNNING:
- if self.kube_config.delete_worker_pods:
+ if self.kube_config.delete_on_success and state is State.SUCCESS:
if not self.kube_scheduler:
raise AirflowException(NOT_STARTED_MESSAGE)
self.kube_scheduler.delete_pod(pod_id)
+ elif self.kube_config.delete_worker_pods:
+ if not self.kube_scheduler:
+ raise AirflowException(NOT_STARTED_MESSAGE)
Review comment:
Yup it is
----------------------------------------------------------------
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