def __get_volumes(self):
"""
Generate the "volumes" argument for the ``register_task_definition()`` call.
:rtype: dict
"""
volume_names = set()
volumes = []
for c in self.containers:
for v in c.volumes:
host_path = v.split(':')[0]
name = self.mount_from_host_path(host_path)
if name not in volume_names:
volumes.append({
'name': name,
'host': {'sourcePath': host_path}
})
volume_names.add(name)
return volumes
评论列表
文章目录