Skip to content

Commit

Permalink
Merge pull request #49 from lvarin/fix-null-volumes
Browse files Browse the repository at this point in the history
fix: handle null values for TES volumes
  • Loading branch information
lvarin authored Aug 27, 2024
2 parents 822e46c + e35a17e commit d1fc869
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'pyfakefs',
'pytest-mock'
, 'fs',
'moto',
'moto<5',
'pytest-localftpserver'
]

Expand Down
1 change: 1 addition & 0 deletions src/tesk_core/filer.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def delete(self):

def ftp_login(ftp_connection, netloc, netrc_file):
user = None
password=None
if netrc_file is not None:
creds = netrc_file.authenticators(netloc)
if creds:
Expand Down
8 changes: 6 additions & 2 deletions src/tesk_core/taskmaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ def run_executor(executor, namespace, pvc=None):
if pvc is not None:
mounts = spec['containers'][0].setdefault('volumeMounts', [])
mounts.extend(pvc.volume_mounts)
volumes = spec.setdefault('volumes', [])
volumes.extend([{'name': task_volume_basename, 'persistentVolumeClaim': {
spec.setdefault('volumes', [])
if spec['volumes'] is None:
spec['volumes'] = []
# volumes is a refence to spec['volumes']
# This makes sure the next line does not fail if volumes was originaly "null"
spec['volumes'].extend([{'name': task_volume_basename, 'persistentVolumeClaim': {
'readonly': False, 'claimName': pvc.name}}])
logger.debug('Created job: ' + jobname)
job = Job(executor, jobname, namespace)
Expand Down

0 comments on commit d1fc869

Please sign in to comment.