You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/22 07:27:47 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #23160: Always -f when removing container after DockerOperator execution

uranusjr commented on code in PR #23160:
URL: https://github.com/apache/airflow/pull/23160#discussion_r855849441


##########
airflow/providers/docker/operators/docker.py:
##########
@@ -333,7 +333,7 @@ def _run_image_with_mounts(
             return None
         finally:
             if self.auto_remove:
-                self.cli.remove_container(self.container['Id'])
+                self.cli.remove_container(self.container['Id'], force=True)

Review Comment:
   I can imagine someone would want to debug a container if it fails.
   
   Maybe we should change `auto_remove` to accept either boolean (for compatibility) or a str
   
   ```python
   DockerOperator(
       ...,
       # auto_remove="never",  # Default
       # auto_remove="success",  # Same as 'True'
       # auto_remove="force",  # Add force=True
   )



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org