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/07/01 07:23:47 UTC

[GitHub] [airflow] alexkruc commented on a diff in pull request #24751: Adding Docker context check for breeze

alexkruc commented on code in PR #24751:
URL: https://github.com/apache/airflow/pull/24751#discussion_r911686940


##########
dev/breeze/src/airflow_breeze/utils/docker_command_utils.py:
##########
@@ -299,6 +299,38 @@ def check_docker_compose_version(verbose: bool):
         )
 
 
+def check_docker_context(verbose: bool):
+    """
+    Checks whether Docker is using the expected context
+    :param verbose: print commands when running
+    """
+    expected_docker_context = "default"
+    response = run_command(
+        ["docker", "info", "--format", "{{json .ClientInfo.Context}}"],
+        verbose=verbose,
+        no_output_dump_on_exception=False,
+        text=True,
+        capture_output=True,
+    )
+    if response.returncode != 0:
+        get_console().print(
+            '[error]Could not check for Docker context.[/]\n'

Review Comment:
   You're totally right :) 
   We should return here because it's not making sense checking it further, and also I changed the message to be more actionable.



-- 
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