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

Inspect container state rather than last_state when deciding whether to skip #33702

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

SamWheating
Copy link
Contributor

closes: #33697

Looking at the Kubernetes API Docs for containerStatus, it looks like lastState provides the state of the previous run of the container, whereas state should provide information on the most recent termination (which is the relevant one in this case)

I also added an integration test under kubernetes_tests to verify that this works as expected.

@potiuk potiuk modified the milestone: Airflow 2.7.1 Aug 24, 2023
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.

Makes sense

@@ -225,6 +225,22 @@ def test_delete_operator_pod(self, mock_get_connection):
assert self.expected_pod["spec"] == actual_pod["spec"]
assert self.expected_pod["metadata"]["labels"] == actual_pod["metadata"]["labels"]

def test_skip_on_specified_exit_code(self, mock_get_connection):
Copy link
Member

Choose a reason for hiding this comment

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

❤️ the integration test !

@potiuk potiuk merged commit c477031 into apache:main Aug 24, 2023
47 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.

skip_on_exit_code parameter in KPO does not take effect
3 participants