-
Notifications
You must be signed in to change notification settings - Fork 104
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
Mongodb host: cannot use hostname without port #2219
Comments
You are correct, in the sense that the port in all cases is optional according to the MongoDB documentation (with the default value 27017...). All cases the port is optional. Furthermore, could you test that the mongodb+srv DNS connection type works? Reference: |
Thanks for your willingness to work on this! :) We would be more than happy to review and eventually merge that pull request! |
Hello again, yesterday I opened a pull request with my suggested commit. Let me know if it works out. :) |
Having merged PR #2221, this issue can now be closed. @SavvasMohito thanks for the contribution! :) |
Hello there. I have been using and really enjoying cygnus. While transferring my docker-compose project to a Kubernetes cluster, I came across a problem:
Cygnus accepts MongoDB hosts only when a port is specified (here). This is an issue in my case, where I am using a Kubernetes service for reaching my MongoDB pod, and I only have a hostname (which includes both the IP and Port of the target MongoDB pod). For example, the kubernetes service hostname can be something like "mongodb-service".
I have made a custom image of cygnus to make it work in my case, by replacing the above highlighted code with this:
where uri = the kubernetes service name I provided, and it works.
I understand the need to check the given MongoDB URL but I believe this should be implemented differently and not by checking wether a port has been provided or not. You can, for example, try if the connection works with any given URL (with port or not) directly to MongoDB endpoint. I may have a look into that myself and create a pull request if I manage to make it work. Thanks.
The text was updated successfully, but these errors were encountered: