Feat: Add support for params field in Probe#7755
Merged
simonpasquier merged 18 commits intoprometheus-operator:mainfrom Aug 5, 2025
Merged
Feat: Add support for params field in Probe#7755simonpasquier merged 18 commits intoprometheus-operator:mainfrom
simonpasquier merged 18 commits intoprometheus-operator:mainfrom
Conversation
pkg/prometheus/promcfg.go
Outdated
| paramsMapSlice = append(paramsMapSlice, yaml.MapItem{Key: "module", Value: []string{m.Spec.Module}}) | ||
| } | ||
|
|
||
| if len(m.Spec.Params) != 0 { |
Contributor
There was a problem hiding this comment.
(nit) we don't need to check the length.
pkg/prometheus/promcfg.go
Outdated
|
|
||
| if len(m.Spec.Params) != 0 { | ||
| for k, v := range m.Spec.Params { | ||
| paramsMapSlice = append(paramsMapSlice, yaml.MapItem{Key: k, Value: v}) |
Contributor
There was a problem hiding this comment.
we should prevent conflicts with the module field. E.g. can we skip the parameter if the key is equal to module?
| // The parameters for the scrape | ||
| // +optional | ||
| // +kubebuilder:validation:MinProperties=1 | ||
| Params map[string][]string `json:"params,omitempty"` |
Contributor
There was a problem hiding this comment.
It's not aligned with the Kubernetes API conventions which recommend named subobjects over maps:
I know that we use map[string][]string everywhere else but I'd rather follow the Kubernetes recommendation.
Contributor
Author
|
still pending test cases |
Contributor
Author
|
@simonpasquier All done. Please review |
nutmos
commented
Aug 4, 2025
Contributor
Author
nutmos
left a comment
There was a problem hiding this comment.
Update validation and description as recommended.
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Contributor
Author
|
@simonpasquier can you help review it again? I updated the Name field to be required. |
simonpasquier
approved these changes
Aug 5, 2025
miinsun
pushed a commit
to miinsun/prometheus-operator
that referenced
this pull request
Aug 15, 2025
…d-params Feat: Add support for params field in Probe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add support for params fields in the Probe CRD.
Closes: #7541
Type of change
What type of changes does your code introduce to the Prometheus operator? Put an
xin 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
Using the unit tests
Changelog entry