You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/08/21 05:01:49 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #33547: Avoid WSL2 ones when finding a context for Breeze

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


##########
dev/breeze/src/airflow_breeze/utils/docker_command_utils.py:
##########
@@ -804,23 +805,34 @@ def autodetect_docker_context():
 
     :return: name of the docker context to use
     """
-    output = run_command(["docker", "context", "ls", "-q"], capture_output=True, check=False, text=True)
-    if output.returncode != 0:
+    result = run_command(
+        ["docker", "context", "ls", "--format=json"],

Review Comment:
   Hmm since 20.10.24 already supports `--format` with a Go template, _and_ that syntax is still supported in 23.0, I think it might be better to just use that syntax instead. I’ll work on that.



##########
dev/breeze/src/airflow_breeze/utils/docker_command_utils.py:
##########
@@ -804,23 +805,34 @@ def autodetect_docker_context():
 
     :return: name of the docker context to use
     """
-    output = run_command(["docker", "context", "ls", "-q"], capture_output=True, check=False, text=True)
-    if output.returncode != 0:
+    result = run_command(
+        ["docker", "context", "ls", "--format=json"],

Review Comment:
   Hmm since 20.10.24 already supports `--format` with a Go template, _and_ that syntax is still supported in 23.0, I think it might be better to just use that syntax instead. I’ll work on that.



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