Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add termination_message_policy parameter to KubernetesPodOperator #32885

Merged
merged 12 commits into from
Jul 29, 2023

Conversation

iJanki-gr
Copy link
Contributor

@iJanki-gr iJanki-gr commented Jul 27, 2023

Allow setting termination_message_policy in the Pod container.
My use case is being able to set the value of termination_message_policy to FallbackToLogsOnError.
(https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/operators.html#include-error-message-in-email-alert)

From Pod specification:

terminationMessagePolicy (string)

Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.

Allow setting termination_message_policy in the Pod container
@boring-cyborg boring-cyborg bot added provider:cncf-kubernetes Kubernetes provider related issues area:providers labels Jul 27, 2023
@iJanki-gr iJanki-gr marked this pull request as draft July 27, 2023 13:44
@iJanki-gr iJanki-gr marked this pull request as ready for review July 27, 2023 14:00
@iJanki-gr iJanki-gr marked this pull request as draft July 28, 2023 13:03
@iJanki-gr iJanki-gr marked this pull request as ready for review July 28, 2023 13:03
@iJanki-gr
Copy link
Contributor Author

Not sure if the failing test is a blip or not. How can I rerun the tests?

@amoghrajesh
Copy link
Contributor

You can re run by closing and reopening the pull request or by rebasing the PR

Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

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

Looks good! LGTM

airflow/providers/cncf/kubernetes/operators/pod.py Outdated Show resolved Hide resolved
@eladkal eladkal changed the title KubernetesPodOperator: add termination_message_policy option Add termination_message_policy parameter to KubernetesPodOperator Jul 29, 2023
@eladkal eladkal merged commit bcc7856 into apache:main Jul 29, 2023
44 checks passed
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 provider related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants