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
pkg/prometheus/promcfg*.go: Validate EnforcedBodySizeLimit #4285
pkg/prometheus/promcfg*.go: Validate EnforcedBodySizeLimit #4285
Conversation
48fb1a5
to
410842b
Compare
I think that the operator should be more explicit and fail the reconciliation if the provided parameter is invalid. |
64ff3f3
to
04e21ed
Compare
I propagated the error from validation that should fail sync |
@fpetkovski @simonpasquier Can you review again? |
74057c0
to
ac97b0a
Compare
Nice work, this LGMT! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO the check should happen near the top of *ConfigGenerator.GenerateConfig()
since it's a PrometheusSpec field?
prometheus-operator/pkg/prometheus/promcfg.go
Line 219 in c6b5cc2
func (cg *ConfigGenerator) GenerateConfig( |
ac97b0a
to
bd12b1a
Compare
Good point. I added a func for validating the fields at prometheus crd level. Added the func call in operator.go before calling GenerateConfig @simonpasquier Can you take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you base your change against release-0.51 so it can be part of v0.51.2?
a0c4e4e
to
e753b01
Compare
@simonpasquier I updated with changed and changed the base for PR |
|
Related to prometheus-operator#4282 Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
e753b01
to
6351b32
Compare
6351b32
to
563c6f7
Compare
Done |
@simonpasquier Take a look when you get chance |
929bbf5
to
68ef41c
Compare
68ef41c
to
fd8ab84
Compare
@simonpasquier Thank you for the review. I updated the PR. Hope its good now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
thanks! |
@simonpasquier Curious to know would this change be synced with master only before release of 0.51.2? |
@slashpai yes this is the process. |
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.
Added the input validation for EnforcedBodySizeLimit
Related to #4282
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.)Changelog entry
Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.
cc: @simonpasquier