diff --git a/dev/breeze/src/airflow_breeze/commands/ci_image_commands.py b/dev/breeze/src/airflow_breeze/commands/ci_image_commands.py index 5934bc2358157..b48f58338f6f3 100644 --- a/dev/breeze/src/airflow_breeze/commands/ci_image_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/ci_image_commands.py @@ -441,9 +441,14 @@ def build_ci_image(verbose: bool, dry_run: bool, ci_image_params: BuildCiParams) :param dry_run: do not execute "write" commands - just print what would happen :param ci_image_params: CI image parameters """ - if not ci_image_params.push_image and ci_image_params.is_multi_platform(): + if ( + ci_image_params.is_multi_platform() + and not ci_image_params.push_image + and not ci_image_params.prepare_buildx_cache + ): get_console().print( - "\n[red]You cannot use multi-platform build without using --push-image flag![/]\n" + "\n[red]You cannot use multi-platform build without using --push-image flag or " + "preparing buildx cache![/]\n" ) return 1, "Error: building multi-platform image without --push-image." fix_group_permissions(verbose=verbose) diff --git a/dev/breeze/src/airflow_breeze/commands/production_image_commands.py b/dev/breeze/src/airflow_breeze/commands/production_image_commands.py index e10d46cda4081..544095f0b2af8 100644 --- a/dev/breeze/src/airflow_breeze/commands/production_image_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/production_image_commands.py @@ -480,9 +480,14 @@ def build_production_image( :param dry_run: do not execute "write" commands - just print what would happen :param prod_image_params: PROD image parameters """ - if not prod_image_params.push_image and prod_image_params.is_multi_platform(): + if ( + prod_image_params.is_multi_platform() + and not prod_image_params.push_image + and not prod_image_params.prepare_buildx_cache + ): get_console().print( - "\n[red]You cannot use multi-platform build without using --push-image flag![/]\n" + "\n[red]You cannot use multi-platform build without using --push-image flag" + " or preparing buildx cache![/]\n" ) return 1, "Error: building multi-platform image without --push-image." fix_group_permissions(verbose=verbose)