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(collector): Let pgx library parse TLS parameters #1390

Merged
merged 3 commits into from
Nov 16, 2023

Conversation

banjoh
Copy link
Member

@banjoh banjoh commented Nov 14, 2023

Description, Motivation and Context

This allows the collector to respect the sslmode parameters

Reviewer notes
For the postgres collector, we let pgx library parse TLS parameters via its ParseConfig function instead of the collector's default implementation of construction a tls.Config instance for secure connections. pgx respects the sslmode parameters when constructing a tls.Config instance. Troubleshoot does not need to do this.

We drop the TLS param files to a file and pass them to the library as environment variables, then cleanup after ourselves.

Fix: #1163

Checklist

  • New and existing tests pass locally with introduced changes.
  • Tests for the changes have been added (for bug fixes / features)
  • The commit message(s) are informative and highlight any breaking changes
  • Any documentation required has been added/updated. For changes to https://troubleshoot.sh/ create a PR here

Does this PR introduce a breaking change?

  • Yes
  • No

This allows the collector to respect the sslmode parameters

Fix: replicatedhq#1163
@banjoh banjoh requested a review from a team as a code owner November 14, 2023 13:24
@banjoh banjoh added bug::normal type::bug Something isn't working labels Nov 14, 2023
Copy link
Contributor

@CpuID CpuID left a comment

Choose a reason for hiding this comment

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

LGTM, and tests pass, approved

@banjoh banjoh merged commit d4623d9 into replicatedhq:main Nov 16, 2023
25 checks passed
@banjoh banjoh deleted the em/postgres-sslmode branch November 16, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug::normal type::bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PostgreSQL collector ignoring sslmode parameter in the connection string
2 participants