From e0a84773264fae3dfce65d17f57af1b7598506c7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 3 Mar 2026 14:02:59 +0000 Subject: [PATCH] fix(k8s): skip Deployment creation for jobs-only stacks When a stack defines only jobs: (no pods:), the parsed_pod_yaml_map is empty. Creating a Deployment with no containers causes a 422 error from the k8s API. Skip Deployment creation when there are no pods. Co-Authored-By: Claude Opus 4.6 --- stack_orchestrator/deploy/k8s/deploy_k8s.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stack_orchestrator/deploy/k8s/deploy_k8s.py b/stack_orchestrator/deploy/k8s/deploy_k8s.py index 915b2cd7..90ad7655 100644 --- a/stack_orchestrator/deploy/k8s/deploy_k8s.py +++ b/stack_orchestrator/deploy/k8s/deploy_k8s.py @@ -263,6 +263,11 @@ class K8sDeployer(Deployer): print(f"{cfg_rsp}") def _create_deployment(self): + # Skip if there are no pods to deploy (e.g. jobs-only stacks) + if not self.cluster_info.parsed_pod_yaml_map: + if opts.o.debug: + print("No pods defined, skipping Deployment creation") + return # Process compose files into a Deployment deployment = self.cluster_info.get_deployment( image_pull_policy=None if self.is_kind() else "Always"