-
Notifications
You must be signed in to change notification settings - Fork 0
[MISC] Conditionally create the legacy interface to support Juju 4 #368
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
Conversation
self, | ||
event: pgsql.DatabaseRelationJoinedEvent, # type: ignore | ||
) -> None: | ||
def _on_database_relation_joined(self, event) -> 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.
Type definition, not strictly necessary.
self.db.on.database_relation_joined, self._on_database_relation_joined | ||
) | ||
if self.model.juju_version.major < 4: | ||
pgsql = ops.lib.use("pgsql", 1, "postgresql-charmers@lists.launchpad.net") |
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.
Moved inside the if in case the lib loader also causes issues.
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!
@anvial please test from your side.
P.S. @dragomirp should we block the charm if user request psql relation on Juju 4+ ?
No need IMHO. The interface is only used here to block the provider if roles and extensions are requested. It is not a functional integration in the first place. |
There seems to be an issue with the restart test on VM. Disabling for now to unblock Juju 4. |
Relates to #367