From 70092c5474fd4b60c30c2ba79860735d9b2edf54 Mon Sep 17 00:00:00 2001 From: Max Falk Date: Mon, 10 Jul 2023 11:56:48 +0200 Subject: [PATCH] PAASTA-17941: fix topology spread constraint option by using snake_case instead of camelCase (#3644) Problem ----- Currently, if the Topology Spread Constraints option is set, `setup_kubernetes_job` will fail because the pod spec kwarg `topologySpreadConstraints` is not valid. Solution ----- Use snake_case `topology_spread_constraints` instead. Apparently the translation to valid k8s json manifests happens at a later stage. Signed-off-by: Max Falk --- paasta_tools/kubernetes_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paasta_tools/kubernetes_tools.py b/paasta_tools/kubernetes_tools.py index 6d93d9c81f..5151d42acf 100644 --- a/paasta_tools/kubernetes_tools.py +++ b/paasta_tools/kubernetes_tools.py @@ -1978,9 +1978,9 @@ def get_pod_template_spec( topology_spread_constraints=system_paasta_config.get_topology_spread_constraints(), ) if pod_topology_spread_constraints: - constraints = pod_spec_kwargs.get("topologySpreadConstraints", []) + constraints = pod_spec_kwargs.get("topology_spread_constraints", []) constraints += pod_topology_spread_constraints - pod_spec_kwargs["topologySpreadConstraints"] = constraints + pod_spec_kwargs["topology_spread_constraints"] = constraints termination_grace_period = self.get_termination_grace_period() if termination_grace_period is not None: