Skip to content

Commit

Permalink
chore: yaml safe load
Browse files Browse the repository at this point in the history
Signed-off-by: ThibaultFy <[email protected]>
  • Loading branch information
ThibaultFy committed Apr 25, 2024
1 parent bd89e78 commit 0df805e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/substrapp/kubernetes_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def get_resources_requirements_from_yaml(
*,
yaml_resources: str,
) -> kubernetes.client.V1ResourceRequirements:
resources_dict = yaml.load(yaml_resources, Loader=yaml.FullLoader)
"""Return a kubernetes.client.V1ResourceRequirements object from a yaml string."""
resources_dict = yaml.safe_load(yaml_resources)

return kubernetes.client.V1ResourceRequirements(
requests=resources_dict["requests"], limits=resources_dict["limits"]
)
Expand Down

0 comments on commit 0df805e

Please sign in to comment.