-
Notifications
You must be signed in to change notification settings - Fork 20
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-3562] Don't block on failure to get the db version #578
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #578 +/- ##
=======================================
Coverage 70.83% 70.84%
=======================================
Files 12 12
Lines 3024 3025 +1
Branches 535 536 +1
=======================================
+ Hits 2142 2143 +1
Misses 768 768
Partials 114 114 ☔ View full report in Codecov by Sentry. |
if postgresql_version: | ||
data["version"] = postgresql_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only add the version if we were able to get it.
@@ -319,14 +319,14 @@ def update_endpoints(self, relation: Relation = None) -> None: | |||
if len(relations) == 0: | |||
return | |||
|
|||
postgresql_version = None | |||
try: | |||
postgresql_version = self.charm.postgresql.get_postgresql_version() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively we can use cluster.get_postgresql_version
instead and get the version from the snap.
if current_host: | ||
host = self.current_host | ||
else: | ||
host = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use current_host by default, I think we still need to be able to call the primary for pgbouncer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tnx!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Conditionally update the db version field in legacy relations if database is not accessible.
Related to #352 and #566