Repository navigation
feat: add autoGomemlimit field to the Alertmanager CRD - #8978
Merged
simonpasquier merged 8 commits intoNov 20, 2026
Merged
simonpasquier merged 8 commits into
simonpasquier merged 8 commits into
Conversation
Add a new `autoGomemlimit` field to the Alertmanager CRD to configure the `--auto-gomemlimit`, `--auto-gomemlimit.ratio` and `--auto-gomemlimit.refresh-interval` command-line flags promoted in alertmanager#5464. The flags are only passed when `enabled` is true and the Alertmanager version is >= v0.35.0. The `ratio` field is a resource.Quantity validated by a CEL rule to be greater than 0 and less than or equal to 1. Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
Alertmanager parses its flags with kingpin which rejects
`--auto-gomemlimit=true` for boolean flags ("unexpected true"), so the
container would fail to start. Render the flag without a value instead.
Signed-off-by: dongjiang1989 <[email protected]>
The API server returns resource.Quantity values in canonical form, so a ratio of 0.7 comes back as 700m and was rendered as `--auto-gomemlimit.ratio=0.700`. Normalize the value to the shortest decimal representation instead. Signed-off-by: dongjiang1989 <[email protected]>
dongjiang1989
force-pushed
the
change-auto-gomemlimit
branch
from
November 12, 2026 11:39
f7cb8e4 to
e8845e5
Compare
Member
Author
|
cc @simonpasquier @slashpai PTAL |
* Pass --no-auto-gomemlimit when the enabled field is explicitly false. * Use the GoDuration type for refreshInterval since the Alertmanager flag is parsed with time.ParseDuration(). * Make the e2e test verify the behavior via the Alertmanager container logs instead of the StatefulSet arguments. * Move the Alertmanager version requirement to the struct documentation and simplify the field comments. Signed-off-by: dongjiang1989 <[email protected]>
Member
Author
|
Thx @simonpasquier Please re-check it |
Don't assert on the Alertmanager log message since it comes from a third-party library and the instance being ready already proves that the flags are accepted. Don't pin the Alertmanager version so that the test catches upstream breaking changes, and set a memory limit instead so that the limit is detected from the cgroup. Signed-off-by: dongjiang1989 <[email protected]>
Member
Author
|
@simonpasquier Update e2e case done |
simonpasquier
approved these changes
Nov 20, 2026
1 of 5 tasks
nutmos
added a commit
to nutmos/prometheus-operator
that referenced
this pull request
Nov 21, 2026
prometheus-operator#8978 added AutoGomemlimitSpecApplyConfiguration with files generated by an older Go toolchain. Since the toolchain bump to Go 1.27, gofmt keeps a trailing '//' line on field doc comments, so 'make generate' produces a diff on main and fails the generated-files check for every PR that rebases on it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JV7hff1NwMsAdWCKyJixNp Signed-off-by: Nattapong Ekudomsuk <[email protected]>
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
Alertmanager v0.35.0 promoted the
auto-gomemlimitfeature flag to a regular--auto-gomemlimitflag and added--auto-gomemlimit.refresh-interval(prometheus/alertmanager#5464).This adds an
autoGomemlimitfield to the Alertmanager CRD so these flags can be configured directly:The arguments are only added when
enabledis true and the Alertmanager version is >= v0.35.0.ratiois a resource.Quantity, kept in the (0, 1] range by a CEL validation rule.Need merge #8977 frist
Type of change
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
Unit tests in
pkg/alertmanagercover argument generation and version gating. Added an e2e test that deploys Alertmanager v0.35.0 and checks the StatefulSet arguments.make check-golangandmake check-apipass.Changelog entry