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

fix(inputs.mysql): Handle custom TLS configs correctly #15493

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Jun 12, 2024

Summary

It seems that the Mysql driver now more strictly checks TLS configuration names when parsing the DSN. Therefore, our current strategy of parsing the DSN and then conveniently replace the TLS configuration name in the struct fails as the custom alias is not a registered configuration.

This PR literally replaces the tls=custom part of the configuration with the actual name using a regular expression. This circumvents the parsing issue. The PR also adds unit-test to make sure the regexp is safe.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #15490

@telegraf-tiger telegraf-tiger bot added area/mysql fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jun 12, 2024
@srebhan srebhan self-assigned this Jun 12, 2024
@telegraf-tiger
Copy link
Contributor

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jun 17, 2024
@srebhan srebhan assigned powersj and DStrand1 and unassigned srebhan Jun 17, 2024
@powersj powersj removed their assignment Jun 17, 2024
@DStrand1 DStrand1 merged commit 53ae984 into influxdata:master Jun 17, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.31.1 milestone Jun 17, 2024
srebhan added a commit that referenced this pull request Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mysql fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inputs.mysql can not handle custom TLS configurations
3 participants