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 descriptions for --enable-feature #4214

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

am97
Copy link

@am97 am97 commented Jan 20, 2025

Currently, passing multiple --enable-feature doesn't work:

$ docker run --rm -it --entrypoint sh prom/alertmanager:v0.28.0
/alertmanager $ alertmanager --config.file=/etc/alertmanager/alertmanager.yml --enable-feature=auto-gomemlimit --enable-feature=auto-gomaxprocs
alertmanager: error: flag 'enable-feature' cannot be repeated, try --help

The intended syntax seems to be a single --enable-feature flag, with a comma-separated list of features as value. This is what is tested here:

{
name: "with both, valid and invalid feature flags",
featureFlags: strings.Join([]string{FeatureReceiverNameInMetrics, "somethingbad"}, ","),
err: errors.New("Unknown option 'somethingbad' for --enable-feature"),
},

Signed-off-by: Andrés Maldonado <[email protected]>
Copy link
Contributor

@grobinson-grafana grobinson-grafana left a comment

Choose a reason for hiding this comment

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

I would prefer we put what it does first and the expected format second. Otherwise LGTM!

cli/root.go Outdated Show resolved Hide resolved
Co-authored-by: George Robinson <[email protected]>
Signed-off-by: am97 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants