This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new e6d5864800 Do not fail when docker context cannot be used (#32497)
e6d5864800 is described below
commit e6d5864800ef0214db20a8007eac1d9d284eacab
Author: Jarek Potiuk <[email protected]>
AuthorDate: Mon Jul 10 19:30:34 2023 +0200
Do not fail when docker context cannot be used (#32497)
This is a follow-up after #32494 and #32463, where autodetection of
docker context has been added. There is a weird relation between
builders and docker context - sometimes they have to be used in sync,
and sometimes not. For example when we are creating a new context
manually (airxflow_cache) to build images in parallel on ARM/x86,
we should use airflow_cache as buider, but the context should
remain "default". On the other hand when we are using "desktop-linux"
builder, we MUST switch the context to "desktop-linux".
This PR is an attempt to make best effort to switch to the same
context as the builder, but instead of failing, we just warn
if can't and continue.
---
dev/breeze/src/airflow_breeze/utils/docker_command_utils.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
b/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
index e612358a4f..ca44e9ae58 100644
--- a/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
+++ b/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
@@ -845,8 +845,6 @@ def get_and_use_docker_context(context: str):
output = run_command(["docker", "context", "use", context], check=False)
if output.returncode != 0:
get_console().print(
- "[error] Error when switching context. Add `--builder default` to
your command "
- "and report the issue on #airflow-breeze channel in Airflow
Slack[/]"
+ f"[warning] Could no use the context {context}. Continuing with
current context[/]"
)
- sys.exit(output.returncode)
return context