Skip to content
Permalink
Browse files

Don't set docker volume if executor path is relative

  • Loading branch information...
pschorf authored and scrosby committed May 16, 2019
1 parent 59901f2 commit 25db93dcec0e088b1ae2f03f9405e5381b0c7e85
Showing with 10 additions and 7 deletions.
  1. +10 −7 integration/tests/cook/util.py
@@ -410,14 +410,17 @@ def minimal_job(**kwargs):
}
job.update(kwargs)
no_container_volume = os.getenv('COOK_NO_CONTAINER_VOLUME') is not None
if not no_container_volume and is_cook_executor_in_use() and 'container' in job:
if 'volumes' not in job['container']:
job['container']['volumes'] = []
if (not no_container_volume
and is_cook_executor_in_use()
and 'container' in job):
config = settings(retrieve_cook_url())
executor_path = config['executor']['command']
executor_dir = os.path.dirname(os.path.dirname(executor_path))
job['container']['volumes'].append({'host-path': executor_dir,
'container-path': executor_dir})
executor_path = get_in(config, 'executor', 'command')
if not executor_path.startswith('.'):
if 'volumes' not in job['container']:
job['container']['volumes'] = []
executor_dir = os.path.dirname(os.path.dirname(executor_path))
job['container']['volumes'].append({'host-path': executor_dir,
'container-path': executor_dir})
return job


0 comments on commit 25db93d

Please sign in to comment.
You can’t perform that action at this time.