johnhoran commented on code in PR #44357:
URL: https://github.com/apache/airflow/pull/44357#discussion_r1885712347
##########
providers/src/airflow/providers/cncf/kubernetes/callbacks.py:
##########
@@ -83,7 +123,34 @@ def on_pod_completion(*, pod: k8s.V1Pod, client:
client_type, mode: str, **kwarg
pass
@staticmethod
- def on_pod_cleanup(*, pod: k8s.V1Pod, client: client_type, mode: str,
**kwargs):
+ def on_pod_wrapup(
+ *,
+ pod: k8s.V1Pod,
+ client: client_type,
+ mode: str,
+ operator: KubernetesPodOperator,
+ context: Context,
+ **kwargs,
+ ) -> None:
+ """
+ Invoke this callback after all pod completion callbacks but before the
pod is deleted.
+
+ :param pod: the completed pod.
+ :param client: the Kubernetes client that can be used in the callback.
+ :param mode: the current execution mode, it's one of (`sync`, `async`).
+ """
+ pass
Review Comment:
As for the need for `on_pod_wrapup` my thought here was that you might have
multiple callbacks running before a sidecar container is killed. Rather than
attaching mutliple sidecars to the container, you could have a class that
attaches a single sidecar and kills it in the `on_pod_wrapup`, any subclasses
of it could pull whatever files they need or run any commands in the pod during
the `on_pod_completion` callback.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]