Skip to content

Fix KuberetesPodTriggerer use correct parameter name to read pod logs.#58489

Merged
jscheffl merged 2 commits into
apache:mainfrom
boschglobal:bugfix/kubernetes-hook-log-read-uses-right-parameter-name
Nov 20, 2025
Merged

Fix KuberetesPodTriggerer use correct parameter name to read pod logs.#58489
jscheffl merged 2 commits into
apache:mainfrom
boschglobal:bugfix/kubernetes-hook-log-read-uses-right-parameter-name

Conversation

@AutomationDev85

Copy link
Copy Markdown
Contributor

Overview

read_namespaced_pod_log expects the container name in the container parameter, not container_name. The incorrect argument prevented KubernetesPodTrigger from fetching logs, causing the trigger to emit an error while the task kept running on the worker.

Change Summary

  • Use correct container argument when calling read_namespaced_pod_log.
  • Update unit tests to assert the proper call signature.

@jscheffl jscheffl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups. Thanks for the fix!

How can it be that this was not detected? In Pytest this is mocked... but is there another way to prevent a regression like this?

@AutomationDev85

Copy link
Copy Markdown
Contributor Author

We could only detect this reliably with tests that exercise real Kubernetes API interactions in the triggerer. Implementing such integration tests would require substantially more time and resources than we currently have available.

@jscheffl jscheffl merged commit db02322 into apache:main Nov 20, 2025
94 checks passed
Copilot AI pushed a commit to jason810496/airflow that referenced this pull request Dec 5, 2025
apache#58489)

* Use correct parameter name in read_namespaced_pod_log call.

* Fix unit test

---------

Co-authored-by: AutomationDev85 <AutomationDev85>
itayweb pushed a commit to itayweb/airflow that referenced this pull request Dec 6, 2025
apache#58489)

* Use correct parameter name in read_namespaced_pod_log call.

* Fix unit test

---------

Co-authored-by: AutomationDev85 <AutomationDev85>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants