Skip to content

Commit

Permalink
chore: review guilhem
Browse files Browse the repository at this point in the history
Signed-off-by: ThibaultFy <[email protected]>
  • Loading branch information
ThibaultFy committed May 16, 2024
1 parent e9325ed commit dc145b9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions backend/substrapp/kubernetes_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,9 @@ def get_resources_requirements_from_yaml(
"""Return a kubernetes.client.V1ResourceRequirements object from a yaml string."""
resources_dict = yaml.safe_load(yaml_resources)

try:
requests = resources_dict["requests"]
except KeyError:
requests = None
requests = resources_dict.get("requests", None)

try:
limits = resources_dict["limits"]
except KeyError:
limits = None
limits = resources_dict.get("limits", None)

return kubernetes.client.V1ResourceRequirements(requests=requests, limits=limits)

Expand Down

0 comments on commit dc145b9

Please sign in to comment.