Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature Request: Automatically generate list of remote volumes #917
I've recently discovered telepresence, and quickly got hooked. I have a whole bunch of micro-services running on k8s, each with a different list of volume mounts. Instead of having to manually create sym-links or use
To solve these problems, I propose adding a
With this in hand, I can do something like this in the entry-point of my container:
def telepresence_remote_mounts(): mounts = os.environ.get('TELEPRESENCE_MOUNTS') if not mounts: return tele_root = os.environ.get('TELEPRESENCE_ROOT') for mount in mounts.split(':'): dir_name, link_name = os.path.split(mount) os.makedirs(dir_name, exist_ok=True) link_src = os.path.join(tele_root, mount[1:]) os.symlink(link_src, mount)
If I'm running telepresence, I get all the volumes where they would normally be, and everything works as expected. If I'm in production, the environment variable is not present and nothing changes.
This saves me from having to manually maintain a list of volume mounts for each micro-service, and standardizes the telepresence workflow across all of them.
I will submit a pull request for consideration shortly.