elixir-cloud-aai / tesk-core

Python code that is launched as images into the Kubernetes cluster by tesk-api.
Apache License 2.0
2 stars 13 forks source link

fix: handle null values for TES volumes #49

Closed lvarin closed 3 months ago

lvarin commented 3 months ago

If spec.template.spec.volumes is null, use [] instead of None.

This is just to make taskmaster more robust

Summary by Sourcery

Fix the handling of null values in spec.template.spec.volumes by defaulting to an empty list to enhance robustness.

Bug Fixes:

sourcery-ai[bot] commented 3 months ago

Reviewer's Guide by Sourcery

This pull request addresses a robustness issue in the taskmaster component. It modifies the run_executor function in src/tesk_core/taskmaster.py to handle the case where spec.template.spec.volumes is None by initializing it as an empty list before extending it with volume information.

File-Level Changes

Files Changes
src/tesk_core/taskmaster.py Added a check to initialize 'volumes' as an empty list if it is None

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.