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

[DPE-3180] Share connection info with host application #13

Merged
merged 4 commits into from
Jan 9, 2024

Conversation

MiaAltieri
Copy link
Contributor

Issue

application hosting the subordinate charm mongos does not receive its credentials for communicating with the sharded mongodb deployment

@@ -35,7 +35,7 @@

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 5
LIBPATCH = 2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ported file over from mongodb charm

Copy link

codecov bot commented Jan 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (6/edge@72ed4cf). Click here to learn what that means.

Additional details and impacted files
@@            Coverage Diff            @@
##             6/edge      #13   +/-   ##
=========================================
  Coverage          ?   75.63%           
=========================================
  Files             ?        3           
  Lines             ?      238           
  Branches          ?        0           
=========================================
  Hits              ?      180           
  Misses            ?       58           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Mehdi-Bendriss
Mehdi-Bendriss previously approved these changes Jan 8, 2024
Copy link
Contributor

@Mehdi-Bendriss Mehdi-Bendriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! just 1 minor nit

lib/charms/mongos/v0/mongos_client_interface.py Outdated Show resolved Hide resolved
src/config.py Outdated
Comment on lines 14 to 16
MONGOS_SOCKET_URI_FMT = (
"%2Fvar%2Fsnap%2Fcharmed-mongodb%2Fcommon%2Fvar%2Fmongodb-27018.sock"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can simplify this with the following:

from urllib.parse import quote

MONGOS_SOCKET_URI_FMT = quote(MONGOS_SOCKET, safe='')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

@MiaAltieri MiaAltieri merged commit 0ae4608 into 6/edge Jan 9, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants