-
Notifications
You must be signed in to change notification settings - Fork 14
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
Skip database creation for mysqlrouter
extra user role
#210
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,16 +218,25 @@ def _on_database_requested(self, event: DatabaseRequestedEvent): | |
self.database.set_endpoints(relation_id, rw_endpoints) | ||
self.database.set_version(relation_id, db_version) | ||
self.database.set_read_only_endpoints(relation_id, ro_endpoints) | ||
# TODO: | ||
# add setup of tls, tls_ca and status | ||
self.charm._mysql.create_application_database_and_scoped_user( | ||
db_name, db_user, db_pass, "%" | ||
) | ||
|
||
if "mysqlrouter" in extra_user_roles: | ||
self.charm._mysql.create_application_database_and_scoped_user( | ||
db_name, | ||
db_user, | ||
db_pass, | ||
"%", | ||
# MySQL Router charm does not need a new database | ||
create_database=False, | ||
) | ||
self.charm._mysql.grant_privileges_to_user( | ||
db_user, "%", ["ALL PRIVILEGES"], with_grant_option=True | ||
) | ||
else: | ||
# TODO: | ||
# add setup of tls, tls_ca and status | ||
Comment on lines
+235
to
+236
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JFMI, is it still topical? mysql-router-k8s supports TLS since the last sprint AFAIK, mysql-router is subordinate == no TLS. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure—also this is the mysql charm, not the mysql router charm |
||
self.charm._mysql.create_application_database_and_scoped_user( | ||
db_name, db_user, db_pass, "%" | ||
) | ||
|
||
logger.info(f"Created user for app {remote_app}") | ||
except ( | ||
|
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.
should this libpatch be 27 instead?
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.
preemptively bumped it for #208
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.
I suspect CI will fail if you try to release LIBPATCH = 27 after merging this LIBPATCH = 28 (also, AFAIK charmcraft will refuse to upload the library with gap in LIBPATCH). I could be wrong.
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.
yes my plan was to merge #208 first