nyxrv0id opened a new pull request, #75479:
URL: https://github.com/apache/airflow/pull/75479
closes: #75014
### Description
#75016 introduced `log_events_on_startup` (defaulting to `True`) to
`KubernetesPodOperator` and `KubernetesPodTrigger` to allow disabling the
startup pod event watcher on clusters with high event churn.
While `GKEStartPodOperator` and `EksPodOperator` inherit from
`KubernetesPodOperator` and honored the flag in synchronous mode, the parameter
was lost in deferrable mode:
- `GKEStartPodOperator.invoke_defer_method` constructed `GKEStartPodTrigger`
with an explicit argument list omitting `log_events_on_startup`, and
`GKEStartPodTrigger.serialize()` did not preserve it.
- `EksPodOperator.invoke_defer_method` constructed `EksPodTrigger` without
`log_events_on_startup`, and `EksPodTrigger.__init__` had a fixed keyword-only
signature without `log_events_on_startup` or `**kwargs`.
### Changes
1. **Google Provider:**
- Forward `log_events_on_startup=self.log_events_on_startup` in
`GKEStartPodOperator.invoke_defer_method`.
- Update `GKEStartPodTrigger.serialize()` to conditionally emit
`"log_events_on_startup": False` only when disabled, keeping default
serialization identical and backwards-compatible with older triggerers.
2. **Amazon Provider:**
- Forward `log_events_on_startup=self.log_events_on_startup` in
`EksPodOperator.invoke_defer_method`.
- Add `log_events_on_startup: bool = True` to `EksPodTrigger.__init__`
and pass it to `super().__init__()`.
- Default serialization remains unchanged; when `False`,
`super().serialize()` emits it and `EksPodTrigger` deserializes cleanly.
3. **Documentation:**
- Update `providers/cncf/kubernetes/docs/operators.rst` to remove the
limitation stating that GKE and EKS deferrable triggers do not forward the
parameter.
4. **Tests:**
- Regression tests in Google provider for operator defer forwarding
(`test_invoke_defer_method`), conditional serialization
(`test_serialize_emits_log_events_on_startup_only_when_disabled`), and disabled
event watching in `_wait_for_pod_start`.
- Regression tests in Amazon provider for operator defer forwarding
(`test_invoke_defer_method_passes_log_events_on_startup_to_trigger`),
serialization round-trip
(`test_serialize_emits_log_events_on_startup_only_when_disabled`), and disabled
event watching in `_wait_for_pod_start`.
### Compatibility & Dependencies
- Default serialization for both triggers remains unchanged (the key is
omitted when `True`).
- Provider dependency constraints in `pyproject.toml` are left untouched as
the base change in `cncf-kubernetes` has not yet been published to PyPI
(unreleased).
---
##### Was generative AI tooling used to co-author this PR?
[✓] Yes (please specify the tool below)
Generated-by: Antigravity following the guidelines
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
--
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]