-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Description
Apache Airflow Provider(s)
cncf-kubernetes, google
Versions of Apache Airflow Providers
I guess you can take the latest ones, should be reproducible there, but definitely those included in official Docker image for 2.10.5.
Apache Airflow version
2.10.5
Operating System
Linux
Deployment
Other Docker-based deployment
Deployment details
Using official Docker image in k8s (issue is related to usage of GKEStartPodOperator)
What happened
Starting at this line
airflow/providers/google/src/airflow/providers/google/cloud/operators/kubernetes_engine.py
Line 641 in 2b1c275
| if is_delete_operator_pod is not None: |
airflow/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py
Line 1047 in 2b1c275
| should_delete_pod = (self.on_finish_action == OnFinishAction.DELETE_POD) or ( |
What you think should happen instead
I guess another way to compare the enums could be used here so the pods are deleted if operator is properly configured.
How to reproduce
Use GKEStartPodOperator to run a job in k8s environment with on_finish_action='DELETE_POD' - the pod will be kept with message "Skipping deleting pod" instead of deletion.
Anything else
I changed the equality test to (str(self.on_finish_action) == str(OnFinishAction.DELETE_POD)) and it worked properly although it's not the best way to fix it. Looks like the property self.on_finish_action is of type str and cannot be directly compared to enum.
Skipping deleting pod
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct