From bcea1b00878facdb3bc58d76c81e76dea884ba8e Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 19 Nov 2023 14:16:55 -0700 Subject: [PATCH] Check for legal presence of --kube-config --- stack_orchestrator/deploy/deployment_create.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stack_orchestrator/deploy/deployment_create.py b/stack_orchestrator/deploy/deployment_create.py index c9ba3a10..9b2945a6 100644 --- a/stack_orchestrator/deploy/deployment_create.py +++ b/stack_orchestrator/deploy/deployment_create.py @@ -264,6 +264,10 @@ def init(ctx, config, kube_config, output, map_ports_to_host): spec_file_content = {"stack": stack, "deploy-to": deployer_type} if deployer_type == "k8s": spec_file_content.update({constants.kube_config_key: kube_config}) + else: + # Check for --kube-config supplied for non-relevant deployer types + if kube_config is not None: + error_exit(f"--kube-config is not allowed with a {deployer_type} deployment") if default_spec_file_content: spec_file_content.update(default_spec_file_content) config_variables = _parse_config_variables(config)