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: apply TLS scrape class to all objects #6573

Merged
merged 1 commit into from May 13, 2024

Conversation

simonpasquier
Copy link
Contributor

Description

Before this change, the TLS configuration from the scrape class wasn't applied to the generated configuration for PodMonitor, ScrapeConfig and Probe objects.

Closes #6556

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

Fix TLS configuration from scrape classes not being applied to `PodMonitor`, `Probe` and `ScrapeConfig` objects.

Before this change, the TLS configuration from the scrape class wasn't
applied to the generated configuration for PodMonitor, ScrapeConfig and
Probe objects.

Closes prometheus-operator#6556

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@simonpasquier simonpasquier requested a review from a team as a code owner May 7, 2024 13:18
@simonpasquier
Copy link
Contributor Author

@nicolastakashi it looks like we only covered ServiceMonitor in the initial implementation of ScrapeClass... The golden files show that the TLS configuration is now propagated to the final configuration.

@nicolastakashi
Copy link
Contributor

@nicolastakashi it looks like we only covered ServiceMonitor in the initial implementation of ScrapeClass... The golden files show that the TLS configuration is now propagated to the final configuration.

Good catch 👏🏽

@ArthurSens
Copy link
Member

I'm not sure I understand why this bug is happening in the first place. Is it related to this new mergeSafeTLS... function you added?

@ArthurSens
Copy link
Member

I'm not sure I understand why this bug is happening in the first place. Is it related to this new mergeSafeTLS... function you added?

Didn't mean to be a blocker though :)

@ArthurSens ArthurSens merged commit 508b6b6 into prometheus-operator:main May 13, 2024
17 checks passed
@simonpasquier simonpasquier deleted the fix-6556 branch May 13, 2024 14:55
@simonpasquier
Copy link
Contributor Author

@ArthurSens the reason was that the MergeTLSConfigWithScrapeClass() function was only called when the SafeTLSConfig field wasn't nil. So it didn't work when the scrape object didn't specify a TLS config.

@ArthurSens
Copy link
Member

aaaaaah ok got it! thanks!

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

Successfully merging this pull request may close these issues.

tlsConfig from scrape class not added to PodMonitor jobs
3 participants