Skip to content

Commit

Permalink
PAASTA-17941: fix topology spread constraint option by using snake_ca…
Browse files Browse the repository at this point in the history
…se 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 <[email protected]>
  • Loading branch information
gmdfalk authored Jul 10, 2023
1 parent 09a9e32 commit 70092c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paasta_tools/kubernetes_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 70092c5

Please sign in to comment.