Skip to content

Cld 9544 provisioner fix mysql db connection string#1139

Merged
andrleite merged 4 commits intomasterfrom
CLD-9544-provisioner-fix-mysql-db-connection-string
Nov 10, 2025
Merged

Cld 9544 provisioner fix mysql db connection string#1139
andrleite merged 4 commits intomasterfrom
CLD-9544-provisioner-fix-mysql-db-connection-string

Conversation

@andrleite
Copy link
Copy Markdown
Contributor

@andrleite andrleite commented Nov 7, 2025

Summary

This pull request enhances the handling of MySQL database connection strings by adding support for a new "datasource URL" format (without the mysql:// prefix) in the database secret generation and Kubernetes secret creation processes. This change ensures that both the original connection string and the datasource URL are available for use in different contexts, improving compatibility and flexibility.

MySQL connection string improvements:

  • Updated the MattermostMySQLConnStrings function to return an additional datasource URL (connection string without the mysql:// prefix), alongside the existing connection string and read replica string.
  • Modified both RDSDatabase.GenerateDatabaseSecret and RDSMultitenantDatabase.GenerateDatabaseSecret to capture and store the new datasource URL in the generated secret.

Secret structure and Kubernetes integration:

  • Added a new DataSourceURL field to the InstallationDBSecret struct to store the datasource URL.
  • Updated the ToK8sSecret method to include the datasource URL as MM_SQLSETTINGS_DATASOURCE in the generated Kubernetes secret if it is present.
  • Extended the unit tests in secret_test.go to verify correct handling of the datasource URL in secrets, including cases where it is present and absent.

Secret generation updates:

  • Ensured that the new DataSourceURL field is set when generating secrets for both single-tenant and multitenant RDS databases.

Ticket Link

https://mattermost.atlassian.net/browse/CLD-9544

Release Note

fix mysql database connection string

@mm-cloud-bot mm-cloud-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 7, 2025
@andrleite andrleite requested review from a team, fmartingr and nickmisasi November 7, 2025 14:19
Copy link
Copy Markdown
Contributor

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

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

Same as the other one, LGTM but I'm not sure why we are fixing MySQL related things. Am I missing context here?

@andrleite
Copy link
Copy Markdown
Contributor Author

Same as the other one, LGTM but I'm not sure why we are fixing MySQL related things. Am I missing context here?

We still have a few customers using it, and our QA team is using MySQL to test old versions.

@andrleite andrleite merged commit 25b76c4 into master Nov 10, 2025
13 checks passed
@andrleite andrleite deleted the CLD-9544-provisioner-fix-mysql-db-connection-string branch November 10, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants