Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing environment tries to install irods packages in database container when --project-name argument has underscores #226

Open
SwooshyCueb opened this issue Aug 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SwooshyCueb
Copy link
Member

We have a few functions in context.py that try to pull information from container names by splitting them by underscores:

def project_name(container_name):
"""Return the docker-compose project name based on the `container_name`.
NOTE: docker-compose "sanitizes" project names to remove certain special characters, so the
`--project-name` provided to `docker-compose` may be different from the project name used
when constructed the name of the image(s) and container(s).
Arguments:
container_name -- the name of the container from which the project name is extracted
"""
return container_name.split('_')[0]
def service_name(container_name):
"""Return the docker-compose project service name based on the `container_name`.
Arguments:
container_name -- the name of the container from which the service name is extracted
"""
return container_name.split('_')[1]
def service_instance(container_name):
"""Return the service instance number based on the `container_name`.
Arguments:
container_name -- the name of the container from which the service instance is extracted
"""
return int(container_name.split('_')[2])

However, the --project-name argument to the runner scripts allows the user to specify a string that will, among other things, be used as the first part of the container names. If the user specifies a name with underscores, these functions will return the wrong values. This causes the testing environment to attempt to install irods packages in the database container, which will fail under most circumstances due to distro mismatch.

@SwooshyCueb SwooshyCueb added the bug Something isn't working label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant