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

feat(ProxyConfig): Update CRD for ProxyConnectHeader type #6541

Conversation

dongjiang1989
Copy link
Contributor

@dongjiang1989 dongjiang1989 commented Apr 22, 2024

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Prometheus config says that it's a `map[string][]string` while the CRD field is equivalent to a `map[string]string`. 
Given that ScrapeConfig is v1alpha1 and that ProxyConnectHeader has a niche usage, I'd be inclined to "fix" the CRD now

Originally posted by @simonpasquier in #6531 (comment)

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.

Update CRD for ProxyConnectHeader type

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
@dongjiang1989 dongjiang1989 requested a review from a team as a code owner April 22, 2024 03:35
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
@dongjiang1989
Copy link
Contributor Author

fix #6523

proxyConnectHeader[k] = value
proxyConnectHeader[k] = []string{}
for _, s := range v {
value, _ := store.GetKey(ctx, namespace, monitoringv1.SecretOrConfigMap{
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why we use monitoringv1.SecretOrConfigMap{} here. Can we change to store.GetSecretKey?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Done. Please re-check
@simonpasquier

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
@dongjiang1989
Copy link
Contributor Author

@simonpasquier PTAL, when you have time

Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Thanks!

@simonpasquier simonpasquier merged commit 5a61e1d into prometheus-operator:main May 14, 2024
17 checks passed
@dongjiang1989 dongjiang1989 deleted the fix-proxy-connect-header-crd branch May 15, 2024 12:11
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.

None yet

2 participants