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

[feature](WPN-267) Place the new database in the least populated mariadb #26

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

rosamaggi
Copy link
Contributor

Peer programming with @Azecko and @obieler

Copy link
Member

@ponsfrilus ponsfrilus left a comment

Choose a reason for hiding this comment

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

Some parts mix 2 and 4 spaces indentations, I would recommend 4 spaces everywhere as in PEP8.

@rosamaggi rosamaggi requested a review from ponsfrilus January 29, 2025 16:35
Copy link
Member

Choose a reason for hiding this comment

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

Please use 4 spaces whenever possible to fit to PEP8.

Copy link
Member

Choose a reason for hiding this comment

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

There are still some mariadb_min_name variable in the code.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure if the mariadb_name = prefix + self.name is still what we want. As we are getting more that one MariaDB (servers), prefixing the database's name with the server name might be useful to distinguish them in a kubectl get dmdb output.

$ kubectl get dmdb
NAME                READY   STATUS    CHARSET   COLLATE              MARIADB   AGE     NAME
mariadb-wp-db-www   True    Created   utf8mb4   utf8mb4_unicode_ci   mariadb   7d21h   wp-db-www

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we add mariadb_name into the database_name, before doing the deletion of a DB into the operator, self.delete_custom_object_mariadb(self.prefix['db'], "databases"), we need to look for the exact name of the DB by doing a kubectl get databases and filter on the one that contains the name specified into the CR, as we don't know in which mariadb the database is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants