From ac45db21c11db4c2013cd91fcb16eb4c928e9920 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Fri, 16 Feb 2024 06:38:39 -0700 Subject: [PATCH] Warn rather than crash when no containers defined in stack --- stack_orchestrator/build/build_containers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stack_orchestrator/build/build_containers.py b/stack_orchestrator/build/build_containers.py index 7b0957b0..bcc10bb0 100644 --- a/stack_orchestrator/build/build_containers.py +++ b/stack_orchestrator/build/build_containers.py @@ -27,7 +27,7 @@ import subprocess import click import importlib.resources from pathlib import Path -from stack_orchestrator.util import include_exclude_check, get_parsed_stack_config, stack_is_external +from stack_orchestrator.util import include_exclude_check, get_parsed_stack_config, stack_is_external, warn_exit from stack_orchestrator.base import get_npm_registry_url # TODO: find a place for this @@ -164,6 +164,8 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args): containers_in_scope = [] if stack: stack_config = get_parsed_stack_config(stack) + if "containers" not in stack_config or stack_config["containers"] is None: + warn_exit(f"stack {stack} does not define any containers") containers_in_scope = stack_config['containers'] else: containers_in_scope = all_containers