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

Fix AzureContainerInstanceOperator remove_on_error #35212

Merged

Conversation

danielvdende
Copy link
Contributor


The remove_on_error parameter of the AzureContainerInstanceOperator was not working as intended. When set to False it should only skip the removal of the Azure Container Group if the exit code is non-zero. For zero exit codes, the infra should be dropped. This was not happening, because the on_kill method did an additional check for this parameter, even though it was already being checking in the execute function. This led to the Azure infra always being left in place (also on success). This commit fixes that behaviour.

@eladkal
Copy link
Contributor

eladkal commented Oct 30, 2023

Can you please add unit test to cover this change?

@eladkal eladkal requested a review from pankajastro October 30, 2023 04:00
@danielvdende danielvdende force-pushed the dvde/fix-aci-operator-remove-on-error branch from d67e13c to 4d0ad7b Compare October 31, 2023 20:07
The remove_on_error parameter of the AzureContainerInstanceOperator
was not working as intended. When set to `False` it should only
skip the removal of the Azure Container Group **if** the exit code
is non-zero. For zero exit codes, the infra should be dropped. This was
not happening; the Azure infra was always left in place. This commit
fixes that behaviour.
@danielvdende danielvdende force-pushed the dvde/fix-aci-operator-remove-on-error branch from 4d0ad7b to b129113 Compare November 1, 2023 08:12
@danielvdende
Copy link
Contributor Author

@eladkal I just added 1 test and updated an existing one to cover this change.

Copy link
Member

@pankajastro pankajastro left a comment

Choose a reason for hiding this comment

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

LGTM

@eladkal eladkal merged commit 22d5834 into apache:main Nov 8, 2023
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Nov 10, 2023
The remove_on_error parameter of the AzureContainerInstanceOperator
was not working as intended. When set to `False` it should only
skip the removal of the Azure Container Group **if** the exit code
is non-zero. For zero exit codes, the infra should be dropped. This was
not happening; the Azure infra was always left in place. This commit
fixes that behaviour.

Co-authored-by: Elad Kalif <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants