Skip to content

Handle missing container_statuses in pod_manager.get_container_status#47936

Merged
jscheffl merged 2 commits into
apache:mainfrom
ForeverWintr:fix-get-container-status
Mar 26, 2025
Merged

Handle missing container_statuses in pod_manager.get_container_status#47936
jscheffl merged 2 commits into
apache:mainfrom
ForeverWintr:fix-get-container-status

Conversation

@ForeverWintr

Copy link
Copy Markdown
Contributor

I believe there is a small bug in the cncf/kubernetes provider. Previously get_container_status in pod_manager.py would handle cases where pod.status.container_statuses is None, but after #43853 it does not. This PR adds a test illustrating the issue, and fixes it.

@boring-cyborg boring-cyborg Bot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Mar 18, 2025
@boring-cyborg

boring-cyborg Bot commented Mar 18, 2025

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@ForeverWintr

Copy link
Copy Markdown
Contributor Author

@mrk-andreev you are the author of PR I linked, could you give my change a review?

@ForeverWintr ForeverWintr changed the title Fix get container status Handle missing container_statuses in pod_manager.get_container_status Mar 18, 2025
@mrk-andreev

Copy link
Copy Markdown
Contributor

@ForeverWintr, thank you for fixing it! Looks good from my side.

@ForeverWintr
ForeverWintr force-pushed the fix-get-container-status branch 2 times, most recently from a72aa50 to 3ac4a42 Compare March 20, 2025 14:44
@ForeverWintr

Copy link
Copy Markdown
Contributor Author

@jedcunningham or @hussein-awala, could one of you take a look at this?

@eladkal
eladkal force-pushed the fix-get-container-status branch from 3ac4a42 to cf5a408 Compare March 23, 2025 07:40
@eladkal
eladkal requested a review from romsharon98 March 23, 2025 07:41
@ForeverWintr
ForeverWintr force-pushed the fix-get-container-status branch 4 times, most recently from 9377ceb to d77227e Compare March 26, 2025 18:29
@ForeverWintr
ForeverWintr force-pushed the fix-get-container-status branch from d77227e to b9773b1 Compare March 26, 2025 20:46
@jscheffl
jscheffl merged commit 4c4de51 into apache:main Mar 26, 2025
@boring-cyborg

boring-cyborg Bot commented Mar 26, 2025

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@ForeverWintr
ForeverWintr deleted the fix-get-container-status branch March 26, 2025 21:32
pankajkoti pushed a commit to astronomer/airflow that referenced this pull request Mar 28, 2025
…apache#47936)

* Add failing example test

* Handle cases where container_statuses is None
shubham-pyc pushed a commit to shubham-pyc/airflow that referenced this pull request Apr 2, 2025
…apache#47936)

* Add failing example test

* Handle cases where container_statuses is None
aaron-y-chen pushed a commit to aaron-y-chen/airflow that referenced this pull request Apr 4, 2025
…apache#47936)

* Add failing example test

* Handle cases where container_statuses is None
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.

3 participants